Is there a mechanism in HTML5/CSS to ensure same result from duplicated ordered list code?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a mechanism in HTML5/CSS to ensure same result from duplicated ordered list code?
I have a large TOC of nested ordered lists at the beginning of a HTML5 document. Further down the same document, the same TOC is repeated into small segments which are each followed by their own text.
Is there a mechanism in HTML/CSS to ensure that in booth cases the result will be the same?
For example, if a list line in the TOC at the beginning of the document renders as A1c2, the same repeated line before the text should also render as A1c2
It seems to me that the only way is to have each segment in a separate file "included" (somehow) to form the entire HTML document or write a script constructing the first TOC without any text and the second inserting text in the correct place which is tedious and error-prone.
HTML may have a cleaner solution of which I am unaware.
HTML templating engines are abound. So are HTML pre-processors (or macro processors) and static site generators. As for dynamically generated content, NevemTeve already answered this above.
If you're generating the HTML programmatically using a backend framework, a static site generator, a content management system, or whatever, then the answer should be yes.
In many cases, such content is developed using XML “semantic markup” technology, using such technologies as XXE.https://www.xmlmind.com/xmleditor/ You may have heard of “DocBook,” which is how all of those O’Reilly books with animals on the cover were actually produced, including shorter and longer “flavors” of them. https://docbook.org/
The document is created using XML tags which describe what the content, semantically speaking, “is.” Not what it looks like. Then, a technology called XSLT is used to produce various kinds of deliverables from it … including HTML and PDF. Or even Unix/Linux “man” pages.
I once used these techniques to generate several hundred pages of online documentation for a Windows application … simultaneously in 16-bit “Winhelp,” 32-bit Windows help, and HTML pages for the product website.
Last edited by sundialsvcs; 12-30-2021 at 11:50 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.