LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2021, 12:00 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
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.

Thank you for your help.
 
Old 12-30-2021, 12:43 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Non. Je suis propriétaire – No. I am an owner.
Distribution: Apple-selling shops, markets and direct marketing: customers find the farm and buy apples.
Posts: 1,608
Blog Entries: 40

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
code?
 
1 members found this post helpful.
Old 12-30-2021, 02:49 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,851
Blog Entries: 1

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
How to generate html-content programmatically? With JavaScript on client side, or PHP (and many more) on server side.
 
1 members found this post helpful.
Old 12-30-2021, 03:41 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
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.

Last edited by shruggy; 12-30-2021 at 03:51 AM.
 
1 members found this post helpful.
Old 12-30-2021, 10:23 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,198

Rep: Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307Reputation: 5307
If you're writing the HTML by hand, no.

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.
 
1 members found this post helpful.
Old 12-30-2021, 11:39 AM   #6
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,610
Blog Entries: 4

Rep: Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905Reputation: 3905
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.
 
2 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No sound in HTML5(and HTML5 on Youtube) Hoff123 Linux - General 3 09-19-2020 07:46 AM
Is there any ns2 code available for watchdog mechanism in wireless sensor networks? Sudha Rajaram Programming 1 01-28-2012 04:41 AM
CSS - Is there a way to put several lines of HTML into one line using CSS? Chronothread Programming 12 01-05-2011 06:06 AM
LXer: 15 HTML5 Demos Showcasing Prowess of HTML5 Over Adobe Flash LXer Syndicated Linux News 0 08-14-2010 02:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration