Skip to content

missing content directive - #3

Closed
sayaikegawa wants to merge 1 commit into
QuantEcon:masterfrom
sayaikegawa:con1
Closed

missing content directive #3
sayaikegawa wants to merge 1 commit into
QuantEcon:masterfrom
sayaikegawa:con1

Conversation

@sayaikegawa

Copy link
Copy Markdown
Collaborator

Hi @mmcky ,

This PR fixes the issue that "contents" did not show the subtopics like below.
Screen Shot 2020-09-08 at 10 25 50 pm

"Contents" should be able to show the subtopics like below: (Note: this example does not refer to the about python lecture )
Screen Shot 2020-09-08 at 10 27 26 pm

@mmcky

mmcky commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

thanks @sayaikegawa -- would you mind moving this to a local branch for preview building?

@sayaikegawa

Copy link
Copy Markdown
Collaborator Author

Hi @mmcky,
Thank you for your comment. That's so helpful because I wondered why I cannot see preview buildings.

Re this "contents" issue, it seems to occur in all lectures.
I'm wondering whether I should fix this issue in all lectures. This means that I'm wondering whether you would like to "know" particular types of errors that we need to do by hand in this test case or you would like to "fix" all errors in this test case.

If your purpose is the latter, I would like to fix this issue in all lectures at once.

@mmcky

mmcky commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

thanks @sayaikegawa for a recurring issue like this perhaps document:

  1. what currently happens in the source files
  2. what should happen in the source files

and lodge this as an item #4

@mmcky

mmcky commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

@jstac if our theme is similar to sphinx-book-theme with local contents on the right hand margin (cc: @DrDrij) -- we would want to remove these local contents listings right?

@DrDrij

DrDrij commented Sep 9, 2020

Copy link
Copy Markdown
Member

@mmcky I haven't factored in a "local" toc in the prototype so far (I'll have a demo up by Friday).
I think for a user, if a local toc is required for jumping to a section it's useful at the top - the was we have it on lectures currently.
The right column is handy while scrolling but I think in the long run having it permanently visible does not add to user readability.

@mmcky

mmcky commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

roger that - thanks @DrDrij

@jstac

jstac commented Sep 9, 2020

Copy link
Copy Markdown
Contributor

I'm in favor of a minimal, uncluttered design. That's even more important than usual when you're teaching maths...

@mmcky mmcky mentioned this pull request Sep 14, 2020
2 tasks
@mmcky mmcky changed the title fixing contents missing content directive Sep 14, 2020
@mmcky

mmcky commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

Support for contents directives has now been added in executablebooks/sphinx-tomyst#42

@mmcky

mmcky commented Sep 14, 2020

Copy link
Copy Markdown
Contributor

Fixed in #8

@mmcky mmcky closed this Sep 14, 2020
mmcky added a commit that referenced this pull request Aug 3, 2026
…on to v1 (#592)

* Harden linkcheck.yml, declare known false positives, pin to v1

Closes #566.

Hardening, as filed
-------------------
The three improvements from #566, already proven in lecture-python-intro
#783:

- `contents: read` in permissions. The block only granted `issues: write`,
  and because `permissions:` resets every unlisted scope to none, the
  `gh api .../releases/latest` call was running with `contents: none`.
- `set -euo pipefail` and single-asset selection. The old jq emitted one
  line per matching asset with nothing to stop an empty or multi-line
  result flowing into curl; it now selects the first match and fails with
  a clear message when there is none.
- `curl -fsSL` rather than `-sL`, so an HTTP error page is a download
  failure rather than a cryptic tar extraction error.

Verified the new jq against this repo's current latest release: it
returns the publish-2026aug03 tarball, same URL as the old form.

Known false positives
---------------------
action-link-checker v1.1.0 adds an `ignore-patterns` input
(QuantEcon/action-link-checker#2, shipped in #3 there). This declares the
same exemptions the repo already keeps in `lectures/_config.yml` under
`linkcheck_ignore`, which Sphinx's built-in checker honours but this
checker never sees -- it scans built HTML, not the Sphinx config. The
regex syntax is identical, so the entries move across unchanged.

FRED is the one that mattered: it throttles datacenter IP ranges, so it
times out from a runner while returning 200 in under half a second from
a normal network. Seventeen duplicate issues were filed for those links
between April and July.

Checked the patterns against the actual published HTML from the current
release, using the shipped v1.1.0 code rather than a reimplementation:
across 33 files and 955 external anchors, 7 anchors match, 6 distinct
URLs, and no FRED link remains checked. The other 948 are unaffected.

Pinning
-------
Moves from `@main` to `@v1`. #566 recorded the decision to stay on
`@main` on the grounds that it is a first-party action, and that holds,
but v1.1.0 shipped a default-on behaviour change (a recurring finding now
refreshes one issue instead of opening a new one weekly) which reached
this repo the moment it merged. `@v1` still takes patches and features
automatically; it just means a future change of that kind is something we
adopt rather than receive.

The other three consumers -- lecture-python-intro,
lecture-python-advanced.myst and continuous_time_mcs -- should move to
`@v1` too, so the series does not end up split across pinning schemes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Note that Sphinx anchors these patterns and this checker does not

Copilot review of #592. The comment said the entries move across
"unchanged" because the regex syntax matches, which glossed over a real
difference: Sphinx's linkcheck_ignore is applied with re.match, anchored
at the start of the URL, while action-link-checker applies its
ignore-patterns with re.search.

A pattern copied from _config.yml can therefore match more here than it
does there, never less. It makes no difference to the nine current
entries -- each begins with https://, so matching mid-URL would need a
URL with another URL embedded in it -- but a future maintainer adding a
bare domain would get an entry that this checker honours and Sphinx
silently ignores.

Comment text only; the patterns and the behaviour are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

4 participants