delph-in / docs

DELPH-IN Documentation

Home Page:https://delph-in.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some intra-page links don't work

john-a-carroll opened this issue · comments

Internal links within a single page don't work if the target contains any non-alphanumeric characters. In such cases the href strings in the anchors seem to have been canonicalised using different schemes. E.g. on https://github.com/delph-in/docs/wiki/LkbInstallation:

<a href="#amd64_Version">amd64 Version</a>
...
<a href="#libXm.so.4">libXm.so.4</a>

<a id="user-content-amd64-version" class="anchor" href="#amd64-version" aria-hidden="true">
...
<a id="user-content-libxmso4" class="anchor" href="#libxmso4" aria-hidden="true">

We found two possible cases that produced intra-page links:

  1. The explicit use of <<Anchor(XXX)>> macro in the MoinMoin documents. Given the way that MoinMoin translate it to the final HTML, the conversion tool was not able to deal with them automatically. But we have only 25 pages from the old MoinMoin that used this macro:
% grep -R -c "<<Anchor" * | awk -F ":" '$2 > 0 {split($1,a,/\//); print a[1]}'  | sort | uniq
Deepbank
ErgProcessing
ErgSemantics
ErgSemantics(2f)Basics
ErgSemantics(2f)Design
ErgSemantics(2f)Essence
GrammarCatalogue
LADIndonesianMorphology
MatrixCustomizationUnitTesting
MatrixCustomizationWebTesting
MatrixDevTop
MatrixDoc(2f)Number
MatrixRegressionTesting
MoinMoin(2f)InstallDocs
MoinMoin(2f)InstallationsAnleitung
MoinMoin(2f)TextFormatting
MrsRfc
PetInput
PredicateRfc
PythonIdioms
ReppTop
RestfulTop
SyntaxReference
Updating_the_Customization_System
VirtualCoordinationComposition
  1. in some pages, the macro <<TableOfContents>> was used to produce the table of contents. We found 36 pages with that macro in the old wiki. I am looking for a similar functionality in the Git Wiki. Worst case, we have to manual fix them:
% grep -R -c "<<TableOfContents>>" * | awk -F ":" '$2 > 0 {split($1,a,/\//); print a[1]}'  | sort | uniq
CapitolHillTop
FeforParCorp
FftbTop
GrammarPerformance
ItsdbDistributedProcessing
ItsdbProfile
ItsdbProfiling
ItsdbReference
ItsdbTreebanking(2f)ItsdbUpdating
ItsdbTroubleshooting
JacyIdiom
JacyInstallation
JacyLexDb
JacyPerformance
JacyPragmatics
JerezTop
KyotoTop
LexDbEmacsInterface
LkbEmacs
LkbFos
LkbGeneration
LkbInstallation
LkbLtdb
LkbLui
LogonTransfer
MatrixMrsCatb
MtRuleExtraction
MtSetup
NoJa
ParisSchedule
PetRobustness
PetTop
RedwoodsTop
RmrsDesign
TransferModel
WikiSandkasten

Hum, there seems to be no automatic way to generate the table of contents. See this.

Hi @olzama , I fixed the https://github.com/delph-in/docs/wiki/MatrixRegressionTesting using named links <a name="xx"/> and using the default links for sections to give you an example.

Emacs is .... always there to save me! Using https://github.com/ardumont/markdown-toc I fixed https://github.com/delph-in/docs/wiki/GrammarPerformance easily. I cloned the wiki, open the MD file, and executed M-x markdown-toc-generate-toc.. done

@john-a-carroll , just to let you know that I have already fixed the links in https://github.com/delph-in/docs/wiki/LkbInstallation!

Hi @olzama , I fixed the https://github.com/delph-in/docs/wiki/MatrixRegressionTesting using named links <a name="xx"/> and using the default links for sections to give you an example.

Looks like in markdown, the default link to a subheading will look like this:

PageName#lowercased-subheading-with-dashes-instead-of-spaces

So, something like:

# Historical background

will turn into: PageName#historical-background

Perhaps that's better than the <a name=xx/> explicit HTML? Or not?

It depends, in general, I like to have options, so I don't think one is necessarily better than the other. The Emacs package is anyway very useful to generate the ToC.

Done with Part 1. I actually didn't find any instances to fix in some of the pages, e.g. PetInut, or the last one (VirtualCoordinationComposition). But I fixed what I found.

The Emacs package is anyway very useful to generate the ToC.

I am happy to try but not an emacs user.

How do I install the script? I looked at the repo, but the steps there don't start at what would be useful to me (e.g. I don't know where I am supposed to put the script, what I am supposed to open then and where, etc.).

Emacs 27.X has https://www.emacswiki.org/emacs/InstallingPackages. It is a package manager for Emacs. Using it, I installed the package above with M-x package-install

It says it can't find it. I am assuming I need to perform some other steps first but I am not sure where :). In... ~/.emacs ?

I tried also installing from the actual file (using package-install-file, following the instructions, but it says "markdown-mode-2.1` is unavailable.

I tried with versions 25 and 27.

Maybe it depends on the operating system or something? I have OSX.