Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some intra-page links don't work #4

Open
john-a-carroll opened this issue May 11, 2021 · 12 comments
Open

Some intra-page links don't work #4

john-a-carroll opened this issue May 11, 2021 · 12 comments
Assignees

Comments

@john-a-carroll
Copy link
Contributor

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">
@arademaker
Copy link
Member

arademaker commented Jun 2, 2021

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

@arademaker
Copy link
Member

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

@arademaker
Copy link
Member

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.

@arademaker
Copy link
Member

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

@arademaker
Copy link
Member

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

@olzama olzama self-assigned this Jun 3, 2021
@olzama
Copy link
Contributor

olzama commented Jun 4, 2021

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?

@arademaker
Copy link
Member

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.

@olzama
Copy link
Contributor

olzama commented Jun 7, 2021

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.

@olzama
Copy link
Contributor

olzama commented Jun 7, 2021

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.).

@arademaker
Copy link
Member

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

@olzama
Copy link
Contributor

olzama commented Jun 7, 2021

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 ?

@olzama
Copy link
Contributor

olzama commented Jun 7, 2021

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.

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

No branches or pull requests

3 participants