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

Configuration documentation should have a section that focuses on templating workflows. #512

Open
mpacer opened this issue Jan 11, 2017 · 5 comments
Labels

Comments

@mpacer
Copy link
Member

mpacer commented Jan 11, 2017

It is remarkably difficult to find a clean explanation about how to create and use a local configuration file.

At best it's split across a bunch of places, at worst it's incomprehensible from the perspective of someone who doesn't already know most of what they're looking for.

@takluyver
Copy link
Member

Here's the config overview page. I don't want to duplicate this explanation in every project that uses our config system, but we should certainly link to it from the nbconvert config options page.

'Docs need extra work' is something that's probably always going to be true.

@mpacer mpacer changed the title Configuration documentation needs extra work Configuration documentation should have a section that focuses on templating workflows. Jan 13, 2017
@mpacer
Copy link
Member Author

mpacer commented Jan 13, 2017

NBconvert has a different kind of use case for customisation and configuration to the point where it is useful to have an encapsulated document that describes how people can locally create templates that give them the exporting utilities that they want. Ease of output customisation is currently one of the biggest advantages that rmarkdown over our current conversion machinery. This is as much due to the fact that they have a basic model of a document that carries with it specific formatting instructions (rather than a record of an interacting programming environment that can be converted into nice documents) but anything we can do to bridge that gap.

This would include (making a checklist for myself)

  • the distinction between local versions of jupyter_config.py vs. jupyter_notebook_config.py vs. jupyter_nbconvert_config.py
    • this includes explaining whether it will apply to everything vs. the "Download as…" menu option in the notebook vs. command line use of jupyter nbconvert
  • highlighting the distinction between tplx and tpl and the advantages of using extension free template file names
  • explicit common use cases (e.g., hiding prompts, hiding input, hiding output, &c.)
  • linking to the most commonly asked for features that are not going to be incorporated into nbconvert itself (e.g., python-markdown and embedhtml)
  • best practices for writing templates (e.g., not using super() in LaTeX templates if you want to change the use packages and a list of the packages that are most likely needed by most export utilities
  • examples of how to change small things (like font sizes, font faces, &c.) for different publication output formats

@mpacer
Copy link
Member Author

mpacer commented Jan 13, 2017

Some of this should probably be included under https://nbconvert.readthedocs.io/en/latest/customizing.html but I'm worried about adding too much there as it's already a decently intimidating page for those who aren't already familiar with applying templates to structured documents.

@mpacer
Copy link
Member Author

mpacer commented Apr 4, 2017

#554 took care of some of this.

@chrisjsewell
Copy link

hey again @mpacer! This is exactly the issue I came across for creating custom .tplx, as explained here in ipypublish . I found that the inheritance based system made it:

  1. non-trivial to understand the full conversion process (having to go through the inheritance tree to find where particular methods have been implemented/overriden)
  2. difficult to swap in/out multiple rules

So I have written a simple pluginesque system in create_tplx.py to build up the template from 'fragments' (packages, definitions, etc). I'm sure it could be improved but, personally, I find this a lot easier.

@t-makaro t-makaro added the docs label Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants