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

picture.backlinks aren't processed correctly? #9

Closed
cycomachead opened this issue May 6, 2016 · 4 comments
Closed

picture.backlinks aren't processed correctly? #9

cycomachead opened this issue May 6, 2016 · 4 comments
Assignees
Labels

Comments

@cycomachead
Copy link
Contributor

Not sure if the issue with the plugin or gitbook...

I have a figures.md file with the following code:

{% for fig in book.figures %}
   * {{ fig.key }} [{{ fig.list_caption }}]({{ fig.backlink }})
{% endfor %}

And I get the following warning in the console:

warn: page contents/figures.md contains an hyperlink to resource outside spine 'contents/related-work.md#fig5.1' 

It seems like the .md just needs to be a .html, but Gitbook should handle that, right?

@todvora
Copy link
Owner

todvora commented May 9, 2016

Hi,
Thanks for the heads up. It's probably a bug in the plugin. I'll see, what I can do with it. The current Gitbook 3.0-pre API is little bit wild right now :-)

@todvora todvora added the bug label May 9, 2016
@todvora todvora self-assigned this May 9, 2016
@markomanninen
Copy link
Contributor

"It seems like the .md just needs to be a .html, but Gitbook should handle that, right?"

I can confirm that. Instead of changing the plugin code, one could do on the markdown page:

{% for fig in book.figures %}
   * {{ fig.key }} [{{ fig.list_caption }}]({{ fig.backlink.replace('.md', '.html') }})
{% endfor %}

@todvora
Copy link
Owner

todvora commented May 26, 2016

Hi

@markomanninen: thank you, this is a nice workaround. To make it easier for users, I implemented in directly in source code of the plugin (see this line). The second replace has to take care of README.md -> index.html.

Everyone: could you please check, if this works for you in the latest release 0.4.1?

@todvora
Copy link
Owner

todvora commented Jun 22, 2016

Closing due to inactivity. Feel free to reopen, if it's still an issue.
Thanks!

@todvora todvora closed this as completed Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants