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

Add configurable notebook name pattern #1966

Closed
JeppeKlitgaard opened this issue Mar 28, 2023 · 0 comments · Fixed by #1967
Closed

Add configurable notebook name pattern #1966

JeppeKlitgaard opened this issue Mar 28, 2023 · 0 comments · Fixed by #1967

Comments

@JeppeKlitgaard
Copy link
Contributor

JeppeKlitgaard commented Mar 28, 2023

I have a use-case where I need to distinguish between manually written markdown files and those generated by nbconvert, which I would like to do by adding a 'pre-extensionsuch thatnotebook.ipynbwould be written tonotebook.generated.md`.

I suggest changing the output_base configuration option of NbConvertApp such that this may be used with multiple inputs and can contain pattern information using a handlebars format similar to NbConvertApp.output_files_dir (Default: {notebook_name}_files) as detailed in docs

The following two handle variables should be defined:

  • {notebook_name} which is the base name of the notebook file
  • {index} which is the one-indexed position of the notebook in the self.notebooks attribute of the NbConvertApp instance

I believe this change could be made backwards-compatible for all configurations except those containing either of the two handlebar expressions in the output_base option, which I presume no real-world configurations have.

I would be willing to provide a PR adding this functionality

tuncbkose added a commit to tuncbkose/nbconvert that referenced this issue Apr 21, 2023
tuncbkose added a commit to tuncbkose/nbconvert that referenced this issue Apr 21, 2023
tuncbkose added a commit to tuncbkose/nbconvert that referenced this issue Apr 26, 2023
blink1073 added a commit that referenced this issue May 6, 2023
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
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 a pull request may close this issue.

1 participant