Giter VIP home page Giter VIP logo

Comments (24)

mmcky avatar mmcky commented on September 12, 2024

@DrDrij this PR adds support for top level toctree objects. I haven't tested on internal toctree objects yet but so far so good :-).

QuantEcon/sphinxcontrib-jupyter#111

I have update the index*.ipynb files that are generated on the branch for the PR in the jupinx extension on compare-lectures.quantecon.org

image

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

toc elements within lectures need some work

image

from lecture-source-py.

DrDrij avatar DrDrij commented on September 12, 2024

Hmm. There isn't anything specific enough in the HTML (classes etc) to hook onto with CSS.

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@fkazemian I have put together a PR that should fix the index issues during compilation.
QuantEcon/sphinxcontrib-jupyter#111

However it changes the internal implementation when writing lists. I am in the process of updating the lecture set on compare-lectures.quantecon.org to be from this branch of jupinx. When I let you know on slack that the site is updated would you mind looking at some lists at random to see if they have changed?

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@fkazemian

  • amss2 is not fixed on compare-lectures.quantecon.org as that is a fix that happened at the rst level and I have not updated my source files in the build repository.

When you have a chance to check other lists that would be great. Thanks

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024
  • @fkazemian would you mind checking the index objects that have been created this afternoon and are now live on compare-lectures.quantecon.org

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024

Hi @mmcky , I'm checking them ...

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024

about_py
index is fine but there is a tag div here
screenshot from 2018-09-21 11-20-49

there is no problem with aiyagari, but you don't think it should have an index? ( the live version dosen't have it as well)
screenshot from 2018-09-21 11-23-55
also amss3 doesn't have any index:
screenshot from 2018-09-21 11-25-34
chang_credible
Calculating set of sustainable (w,θ) pairs-$-pairs) should be Calculating set of sustainable (w,θ) pairs
screenshot from 2018-09-21 11-27-16

chang_ramsey
Calculating all (w,θ) pairs in CE -−pairs−in−-CE-$) should be Calculating all (w,θ) pairs in CE
screenshot from 2018-09-21 12-09-24

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024

markov_perf doesn't have any index( in live version there is no index as well)

screenshot from 2018-09-21 12-14-14

rob_markov_perf doesn't have any index as well:

screenshot from 2018-09-21 12-18-24

also uncertainty_traps doesn't have any index:
screenshot from 2018-09-21 12-20-05

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024

Hi @mmcky I just finished checking all the lectures. These lecture don't have any index in both generated and live version which is not related to jupinx, but I think they should have it:
uncertainty_traps
rob_markov_perf
markov_perf
amss3
aiyagari

and we have two problem in these lectures: ( you can see their problems above)
chang_credible
chang_ramsey

and there is an additional tag before index in:
about_py

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@DrDrij it looks like you modify the local toc in the theme to drop Contents and the top level, as I just build off of the toc branch and it seems that within lectures toc objects are fixed. If this is the case I will remove my patch from jupinx to drop a level.

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

image

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

ahh - I see. https://github.com/mmcky/quantecon.build.lectures/commit/24756155a016f856031f7103dc86d4120e2bf45f#diff-c45e43ff5986a2189468b78b4c57c2c8R915. I will remove the patch I made to jupinx this is much better

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

ok - the python index pages should now be working.

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@fkazemian would you mind checking the python related index pages and let me know if they are ok?

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024

Hi @mmcky they are now like
screenshot from 2018-09-21 17-18-55

but we can see the problems I mentioned above.

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@fkazemian so is the only issue now clickable titles?

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@fkazemian can you add a PR to add a toc to these lectures (on a lecture-by-lecture basis)

@jstac can you advise if you wish there to be no toc elements for these lectures.

  • uncertainty_traps
  • rob_markov_perf
  • markov_perf
  • amss3
  • aiyagari

Fix markup issues in:

  • chang_credible (math in title)
  • chang_ramsey (math in title)

these are rendering correctly to ipynb so this must be an issue with nbconvert as the generated markdown is correct.

## Contents

- [Credible Government Policies in Chang Model](#Credible-Government-Policies-in-Chang-Model)  
  - [Overview](#Overview)  
  - [The setting](#The-setting)  
  - [Calculating  set of sustainable $(w,\theta)$ pairs](#Calculating--set-of-sustainable-$-(w,\theta)-$-pairs)  

and the html output is

<h2 id="Contents">Contents<a class="anchor-link" href="#Contents">&#182;</a></h2><ul>
<li><a href="#Credible-Government-Policies-in-Chang-Model">Credible Government Policies in Chang Model</a>  <ul>
<li><a href="#Overview">Overview</a>  </li>
<li><a href="#The-setting">The setting</a>  </li>
<li><a href="#Calculating--set-of-sustainable-$-(w,\theta">Calculating  set of sustainable $ (w,\theta) $ pairs</a>-$-pairs)  </li>
</ul>
</li>
</ul>

@DrDrij would you mind checking out nbconvert on the chang_credible lecture at the html stage of nbconvert?

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024
  • the top level index page has now been fixed. The only difference now is Home which is contained in the actual RST file.

image

from lecture-source-py.

fkazemian avatar fkazemian commented on September 12, 2024
  • uncertainty_traps
  • rob_markov_perf
  • markov_perf
  • amss3
  • aiyagari

Hi @mmcky
I've done it here Add Index pages #90 but I add review label for it.

from lecture-source-py.

DrDrij avatar DrDrij commented on September 12, 2024

@DrDrij would you mind checking out nbconvert on the chang_credible lecture at the html stage of nbconvert?

It appears what is happening is nbconvert is stumbling with the markdown in the ipynb file. You see in the below link from the TOC list there are brackets within brackets. So link value is being terminated at the first closing bracket.

" - [Calculating set of sustainable $ (w,\\theta) $ pairs](#Calculating--set-of-sustainable-$-(w,\\theta)-$-pairs) "

This results in the href anchor being cut too soon and the remaining part of the string is being appended after the </a> as shown below.

<li><a href="#Calculating--set-of-sustainable-$-(w,\theta">Calculating set of sustainable $ (w,\theta) $ pairs</a>-$-pairs) </li>

The way to fix this in the markdown is to escape the first closing bracket with %29. I've tested this locally and can confirm this works with nbconvert like so:

" - [Calculating set of sustainable $ (w,\\theta) $ pairs](#Calculating--set-of-sustainable-$-(w,\\theta%29-$-pairs) "

image

The heading in the body of the page however works fine as it doesn't have the double brackets.

"## Calculating set of sustainable $ (w,\\theta) $ pairs\n",

@mmcky Is there a tweak you could make in jupinx to escape brackets within markdown links?

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

thanks @DrDrij - love your work. If we change closing brackets with %29 should we also adjust opening brackets (%28) for consistency?

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

@DrDrij with PR QuantEcon/sphinxcontrib-jupyter#132 I have done that for all inline math that is contained in a topic when targeting html.

from lecture-source-py.

mmcky avatar mmcky commented on September 12, 2024

this is fixed. thanks @DrDrij and @fkazemian for your input no this.

from lecture-source-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.