Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Enable html_link_suffix #22

Closed
wants to merge 3 commits into from
Closed

Enable html_link_suffix #22

wants to merge 3 commits into from

Conversation

yotchang4s
Copy link

I want to control the extension for internal links.
For example, if you hide the extension using the MultiViews feature of Apache.
This is a patch for that.

Fixes summary

  • Change to app.config.html_link_suffix from hard code '.html'(Sphinx has html_link_suffix)
  • Add html_link_suffix to MetaData class
  • Append html_link_suffix to metadata.link

@@ -50,7 +52,7 @@ def make_aggregated_pages(app):
# following pages prev-link to previous page (titled as "Newer")
pagename = "page%d" % (i + 1)
context["prev"]["title"] = UIStr.NEWER
context["prev"]["link"] = "index.html" if i == 1 else "page%d.html" % i
context["prev"]["link"] = "index" if i == 1 else "page%d%s" % (i, context["html_link_suffix"])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't index also get an extension?

@vladris
Copy link
Owner

vladris commented Aug 7, 2013

Thanks! Overall looks good though I added a couple of comments. Would be great to also add a unit test that sets the extension to something different than html and then makes sure all files generated have the expected extension.

@yotchang4s
Copy link
Author

Thank you for the detailed comments!
I have fixed a point that has been pointed out there.
But I'm sorry... I do difficult to write unit tests because I wrote for the first time a python.
If I can create, I would like to Pull Request.

@vladris
Copy link
Owner

vladris commented Aug 13, 2013

You can take a look at tinkertest to see how to write unit tests for Tinkerer, it's pretty easy. You run them using nose (just do pip install nose then run nosetests from tinkertest directory).

@yotchang4s
Copy link
Author

I have tried the pip install nose and nosetest.
I'm trying to make a test by reference to test_category.py.
But the test will be terminated in utils.is_module of test_category.py.

def setup(app):
    if utils.is_module(app):
        return
    app.connect("build-finished", build_finished)

Is there a better way run?

@vladris
Copy link
Owner

vladris commented Aug 24, 2013

Let me take a look at this when I get some time. Setup shouldn't terminate your test.

vladris pushed a commit that referenced this pull request Apr 28, 2014
@yotchang4s yotchang4s closed this Jun 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants