Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on How to establish a relationship between HTML elements (tags)? (i.e., how can one element refer to another one)

Parent

How to establish a relationship between HTML elements (tags)? (i.e., how can one element refer to another one)

+3
−0

Should I use the data-* attributes for this or is there a more idiomatic way?


For context, I'm trying to convert annotated legal PDF documents to HTML. Certain parts of these documents are crossed out when a new amendment is added, timestamped, and a "sticky note" directs readers to the section in the new amendment that supersedes it. My goal is to create a sort of "time machine" (or version controlled) document where one specifies a date, and the document will be rendered with only the parts that would have been in effect at that time.

For example, if this was a quote from one of the PDFs:
From Wikipedia's Gall's Law article.

Complex systems are the best way to start a project. (See amendment 1, 7/30/2024)

(amendment 1, 7/30/2024) A complex system that works is invariably found to have evolved from a simple system that worked. A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over with a working simple system.

My naive initial solution would be something like this:

<p data-date-added="3/9/2021" data-superseded-by-amendment="1">
  Complex systems are the best way to start a project.
</p>
<!-- ... lots of other stuff ... -->
<p data-date-added="7/30/2024" data-amendment-id="1">
  A complex system  that  works  is invariably found
  to have evolved  from a simple system that worked. 
  A complex system designed from scratch never works
  and cannot be patched up to make it work. You have
  to start over with a working simple system.
</p>
History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

2 comment threads

Semantic markup (1 comment)
date format (2 comments)
Post
+0
−0

I wouldn't try to create another single document from this. I'd rather create one document per version, store it along with the version date and provide means to show diffs between versions.

Any Wiki software should provide everything you need.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

Reasoning (1 comment)
Reasoning
GeraldS‭ wrote 5 months ago · edited 5 months ago

You currently have a document that is hard to read. You are creating another document that is equally hard to read, just a little easier to navigate.

Most readers will only need either the current state of the document, or the state of a document at a specific point in time.

Having each of the versions as a separate document will give you both, and will make the document much easier to read.