hyperref icon indicating copy to clipboard operation
hyperref copied to clipboard

Proposal: split up hyperref.dtx and let it be build only as part of the publish process

Open jfbu opened this issue 4 years ago • 2 comments

Currently one can not do git log --follow puenc.def because it is embedded into massive titanosaur hyperref.dtx. For ease of maintenance and comfort of eavesdropper owning a local clone, it would be nice if all files were actually existing in the repo, and their combination into hyperref.dtx only done as part of the publish process. I do understand that this refactoring is a bit complicated. And that there will be difference between puenc.def in repo without the docstrip commented header but inclusive of the code comments, and the puenc.def extracted from hyperref.dtx ending up in people's texmf which has a header and is stripped of code comments.

Probably a ready-made solution has been integrated into l3build? I am not familiar with it; all I can say is that I have such an organization for xint. My repo's xintexpr.sty for example contains all code comments (and even private ones which never make it to the dtx, but here on a public repo this of course would make no sense); when pushing a new release to CTAN, a script assembles the xint.dtx. The CTAN-based TeX distros can then extract user xintexpr.sty with no code comments; actually I submit it in tds.zip form so my build ctan script does the docstrip phase itself (all of this happens in sub-directory which is added to .gitignore). The user manual is itself a separate file not using inconvenient doc format, so I can work on it as a perfectly standard latex file, but this is other matter unrelated.

I find this useful, and I have often used git log --follow in this context. Now hyperref has at least 64 extracted files (half of them about being ".drv" files), and I think in the long term such a refactoring will make maintenance easier.

jfbu avatar Feb 12 '21 08:02 jfbu

Now hyperref has at least 64 extracted files (half of them about being ".drv" files),

sorry for absurdity my glasses were bit blurry. I made a mistaked looking at the guards. Say it has about 30 extracted files.

jfbu avatar Feb 12 '21 08:02 jfbu

whatever the count the number is too great and current maintenance is tricky (as may be seen by several quick updates recently to get all the hidden dependencies ironed out.

Splitting up the file is a possibility but (as with the lt*.dtx) that make up latex.ltx I think we would be likely to use the.dtx extension and conventions. Although very early versions of doc were used with files that could be used as-is and it simply stripped off comments, that becomes very constraining once you use more advanced doc guard features that filter and move around code blocks.

But more specifically with hyperref we have been gradually refactoring it reducing dependencies on the contrib area and moving back to the core latex release. Especially as latex format now contains expl3 and and has the l3backend files already loaded much of the system checking and variation in hyperref can in the end be simplified, but getting there in gradual steps...

davidcarlisle avatar Feb 12 '21 08:02 davidcarlisle