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

👌 IMPROVE: Allow heading_slug_func to be a string #696

Merged
merged 1 commit into from
Feb 11, 2023

Conversation

chrisjsewell
Copy link
Member

@chrisjsewell chrisjsewell commented Feb 10, 2023

myst_heading_slug_func can now also be set to a string,
which will be interpreted as an import path to a function,
e.g. myst_heading_slug_func = "mypackage.mymodule.slugify".

@chrisjsewell chrisjsewell linked an issue Feb 10, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Base: 89.72% // Head: 89.67% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (eb655a5) compared to base (879cfca).
Patch coverage: 82.35% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #696      +/-   ##
==========================================
- Coverage   89.72%   89.67%   -0.06%     
==========================================
  Files          22       22              
  Lines        2658     2674      +16     
==========================================
+ Hits         2385     2398      +13     
- Misses        273      276       +3     
Flag Coverage Δ
pytests 89.67% <82.35%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
myst_parser/config/main.py 86.03% <81.25%> (-0.47%) ⬇️
myst_parser/parsers/docutils_.py 82.87% <100.00%> (+0.68%) ⬆️
myst_parser/config/dc_validators.py 83.63% <0.00%> (-1.82%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

`myst_heading_slug_func` can now also be set to a string,
which will be interpreted as an import path to a function,
e.g. `myst_heading_slug_func = "mypackage.mymodule.slugify"`.
@chrisjsewell chrisjsewell merged commit d743992 into master Feb 11, 2023
@chrisjsewell chrisjsewell deleted the heading_slug_func_str branch February 11, 2023 18:32
`myst_heading_slug_func` can now also be set to a string,
which will be interpreted as an import path to a function,
e.g. `myst_heading_slug_func = "mypackage.mymodule.slugify"`.
:::
Copy link

@Alexey-NM Alexey-NM Feb 13, 2023

Choose a reason for hiding this comment

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

Greate change, thank you.
I think it would be better to add an advice. Something like:

You should set this parameter as string to avoid unnecessary rebuild of a project.

It will save a lot of time for other people.

slinder1 added a commit to slinder1/llvm-project that referenced this pull request Aug 19, 2024
Avoid creating an uncacheable conf variable by using a string instead of
a function reference. Also has the effect of avoiding triggering the
"config.cache" sphinx warning.

Requires myst_parser 0.19.0 (specifically
executablebooks/MyST-Parser#696) which is over a
year old by now. Do we mandate any minimum version for these
dependencies?
slinder1 added a commit to llvm/llvm-project that referenced this pull request Sep 3, 2024
Avoid creating an uncacheable conf variable by using a string instead of
a function reference. Also has the effect of avoiding triggering the
"config.cache" sphinx warning.

Requires myst_parser 0.19.0 (specifically
executablebooks/MyST-Parser#696) which is over a
year old by now. Do we mandate any minimum version for these
dependencies?
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.

myst_heading_slug_func causes changes in config every time
2 participants