Skip to content

Add links to line numbers#7

Open
daftaupe wants to merge 4 commits into
warsus:gh-pagesfrom
daftaupe:gh-pages
Open

Add links to line numbers#7
daftaupe wants to merge 4 commits into
warsus:gh-pagesfrom
daftaupe:gh-pages

Conversation

@daftaupe

@daftaupe daftaupe commented Jan 2, 2026

Copy link
Copy Markdown

As requested by #2, this is an attempt at adding the links from the commentary (now i)frame to the source (now i)frame.

Most of the work has been done using sed, but some late fixes have been done manually.

The result can be seen at https://daftaupe.github.io/lions-/

I tried my best to check the whole document visually, but it's rather long and there can stil be a few links missing here and there.

In addition there are 2 small fixes not really related but I can remove them if you prefer to have them separately.

Pierre-Alain TORET added 4 commits January 1, 2026 20:44
that was partly done using the following commands
sed -i 's/title=\(.*\)(\([0-9][0-9][0-9][0-9]\))/title=\1(_\2_)/' *.html needs to run that a few times to avoid breaking the next/previous links in commentary
to link line numbers in sections "lines XXXX to YYYY"
sed -i 's/lines \([0-9][0-9][0-9][0-9]\) to \([0-9][0-9][0-9][0-9]\)/lines <a target="code" href="..\/all.html#line\1">\1<\/a> to <a target="code" href="..\/all.html#line\2">\2<\/a>/g' *.html
to link line numbers in sections "lines XXXX, YYYY and ZZZZ"
sed -i 's/lines \([0-9][0-9][0-9][0-9]\), \([0-9][0-9][0-9][0-9]\) and \([0-9][0-9][0-9][0-9]\)/lines <a target="code" href="..\/all.html#line\1">\1<\/a>, <a target="code" href="..\/all.html#line\2">\2<\/a> and <a target="code" href="..\/all.html#line\3">\3<\/a>/g' *.html
to link line numbers in sections "lines XXXX and YYYY"
sed -i 's/lines \([0-9][0-9][0-9][0-9]\) and \([0-9][0-9][0-9][0-9]\)/lines <a target="code" href="..\/all.html#line\1">\1<\/a> and <a target="code" href="..\/all.html#line\2">\2<\/a>/g' *.html
to link line numbers in sections "lines XXXX, YYYY"
sed -i 's/lines \([0-9][0-9][0-9][0-9]\), \([0-9][0-9][0-9][0-9]\)/lines <a target="code" href="..\/all.html#line\1">\1<\/a>, <a target="code" href="..\/all.html#line\2">\2<\/a>/g' *.html
to link line numbers in sections "line XXXX"
sed -i 's/line \([0-9][0-9][0-9][0-9]\)/line <a target="code" href="..\/all.html#line\1">\1<\/a>/g' *.html
to link line numbers in sections "Line XXXX"
sed -i 's/Line \([0-9][0-9][0-9][0-9]\)/Line <a target="code" href="..\/all.html#line\1">\1<\/a>/g' *.html
to link line numbers in sections "(XXXX)"
sed -i 's/(\([0-9][0-9][0-9][0-9]\))/(<a target="code" href="..\/all.html#line\1">\1<\/a>)/g' *.html
to link line numbers in sections "(XXXX,YYYY)"
sed -i 's/(\([0-9][0-9][0-9][0-9]\),\([0-9][0-9][0-9][0-9]\))/(<a target="code" href="..\/all.html#line\1">\1<\/a>,<a target="code" href="..\/all.html#line\2">\2<\/a>)/g' *.html
to link line numbers in sections "(XXXX, YYYY)"
sed -i 's/(\([0-9][0-9][0-9][0-9]\), \([0-9][0-9][0-9][0-9]\))/(<a target="code" href="..\/all.html#line\1">\1<\/a>, <a target="code" href="..\/all.html#line\2">\2<\/a>)/g' *.html
sed -i 's/_\([0-9][0-9][0-9][0-9]\)_/\1/g' *.html to remove what the first line did

a few manual edits following all that have also been necessary
@warsus

warsus commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Hi, thanks for the pull request! If you want to can you add the additional sed scripts to lions step in the Makefile?

I'd lake to seperate the iframes change. At the moment I'd miss the possbility to resize/move the divider.
I've also started work on updating plastex and use modern tooling (uv, github actions for automatic publish)
and probably broke a bunch of stuff while doing so.

The Github action rebuilds the whole project and publishes the artifacts (html file), which will then be served.
Unfortunately the manual fixes at the end are therefore no longer possible at the moment.

I might change my mind about all of this.

@daftaupe

Copy link
Copy Markdown
Author

@warsus well I wasn't so sure about how the html was generated, so I'll try to integrate these in the Makefile.

I understand about the iframe, I didn't know you were planning to modernize the whole stuff, which is good news !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants