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

[sphinxext] needs ability to build html without the link to source #1429

Closed
hhsprings opened this issue Oct 24, 2012 · 7 comments
Closed

[sphinxext] needs ability to build html without the link to source #1429

hhsprings opened this issue Oct 24, 2012 · 7 comments

Comments

@hhsprings
Copy link

Sometimes we want.

*** plot_directive.py.trunk 2012-10-24 14:03:19.396181016 +0900
--- plot_directive.py   2012-10-24 14:03:44.939338656 +0900
***************
*** 101,106 ****
--- 101,109 ----
      plot_html_show_formats
          Whether to show links to the files in HTML.

+     plot_html_show_source_link
+         Whether to show links to the source file in HTML.
+ 
      plot_rcparams
          A dictionary containing any non-standard rcParams that should
          be applied before each plot.
***************
*** 300,305 ****
--- 303,309 ----
      app.add_config_value('plot_formats', ['png', 'hires.png', 'pdf'], True)
      app.add_config_value('plot_basedir', None, True)
      app.add_config_value('plot_html_show_formats', True, True)
+     app.add_config_value('plot_html_show_source_link', True, True)
      app.add_config_value('plot_rcparams', {}, True)
      app.add_config_value('plot_apply_rcparams', False, True)
      app.add_config_value('plot_working_directory', None, True)
***************
*** 374,382 ****

  {{ only_html }}

!    {% if source_link or (html_show_formats and not multi_image) %}
     (
!    {%- if source_link -%}
     `Source code <{{ source_link }}>`__
     {%- endif -%}
     {%- if html_show_formats and not multi_image -%}
--- 378,386 ----

  {{ only_html }}

!    {% if (source_link and html_show_source_link) or (html_show_formats and not multi_image) %}
     (
!    {%- if source_link and html_show_source_link -%}
     `Source code <{{ source_link }}>`__
     {%- endif -%}
     {%- if html_show_formats and not multi_image -%}
***************
*** 788,793 ****
--- 792,798 ----
              images=images,
              source_code=source_code,
              html_show_formats=config.plot_html_show_formats,
+             html_show_source_link=config.plot_html_show_source_link,
              caption=caption)

          total_lines.extend(result.split("\n"))
@tacaswell
Copy link
Member

@hhsprings Would it be possible to turn this into a PR?

@pelson
Copy link
Member

pelson commented Jan 17, 2014

👍 - I'd like to see this addition too. Thanks @hhsprings.

@tacaswell
Copy link
Member

Closing this because it seems to already be in the repo from #2645, which seems to be identical to this, which is a bit fishy.

Are @hhsprings and @loicseguin the same person? Do we have issues with miss-attributed code? @pelson @mdboom, do we care?

Closing this as the code issue is resolved.

@loicseguin
Copy link
Contributor

I'm not the same person as @hhsprings

@tacaswell
Copy link
Member

@loicseguin was your PR a copy of this patch?

@loicseguin
Copy link
Contributor

No, it was not. I did not see this patch before, I guess I should have done
a better job at searching existing issues.

2014/1/22 Thomas A Caswell notifications@github.com

@loicseguin https://github.com/loicseguin was your PR a copy of this
patch?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1429#issuecomment-33043614
.

Loïc Séguin-Charbonneau

@tacaswell
Copy link
Member

No worries then. If two people did it, it was clearly needed. Just surprising how similar the two are.

Thanks for the PR and sorry for the noise.

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

4 participants