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

links in text #30

Open
ghostwheel opened this issue Sep 21, 2018 · 1 comment
Open

links in text #30

ghostwheel opened this issue Sep 21, 2018 · 1 comment

Comments

@ghostwheel
Copy link

I'm not sure how links are implemented. Thus, book.lit contains this part:

[Hello World](hello.lit)
[Word Count](wc.lit)
[Hangman](hangman.lit)
[Multiple Files](multiple_files.lit)
[Reference](reference.lit)

I would expect the text in the [] to be the text to be shown, and the text in the () to be the linked file. But instead, the text shown comes from the @title of the lit file. That is unexpected. Is this
on purpose?

Would it be possible to document links? Thanks!

@ivanbakel
Copy link
Contributor

ivanbakel commented Sep 26, 2018

Is this on purpose?

From the code, it's hard to tell. The chapter title is initialised to the contents of the [] in the link, but if the chapter itself has a @title command, that command overwrites the link value.

To disambiguate, you can

  • Not have @title commands in your individual chapter files, or
  • Not have any text in your chapter links i.e. [](yourfilehere.lit).

A warning could be added to clarify what will happen if the title is set twice.

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

2 participants