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

adding ability to add authors and titles #390

Merged
merged 3 commits into from
Oct 22, 2019

Conversation

choldgraf
Copy link
Member

@choldgraf choldgraf commented Oct 8, 2019

This adds a "title" and "author" section to each page of the book (if configured to do so). It's all controlled by edits to _config.yml. Below is a section of the docs I added that explains the behavior.

An example of how it looks: https://deploy-preview-390--jupyter-book.netlify.com/guide/04_publish.html

Updated explanation

This PR is a bit more complex now, as it re-works the way that titles are handled. This means that we now only require the toc.yml file to know the locations of pages, and store each page's title / author within the page metadata itself (rather than relying on toc.yml for this). This gives us a bit more flexibility in what metadata we store in each page, at the cost of some extra complexity because we need to manually look-up each page's metadata within the "build" collection in Jekyll.

The new behavior will automatically infer all page titles from the page's content. If there is a value specified in toc.yml, then it will override whatever is specified in the content. This was the current behavior of JB will remain the same, but if people want to embed the page title with each notebook, they don't have to keep a separate record of the page title in toc.yml.

@@ -85,6 +85,13 @@
url: /advanced/netlify
not_numbered: true

- title: Beta Features
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find it a little confusing both to have this section and all of the above sections explicitly marked BETA. Are you planning to consolidate these ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, these have been consolidated on Master and I'll rebase and fix this one on this PR

" (starting with `# `). If either of these are found, they will be used as the title.\n",
" \n",
"\n",
"## Adding authorship to your book's pages\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it'd be really valuable to have a page with a listed author, just to demo the feature ! Maybe this one ?

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea!

@choldgraf choldgraf added the enhancement New feature or request label Oct 15, 2019
@choldgraf
Copy link
Member Author

choldgraf commented Oct 19, 2019

The latest commit updates this a little bit - see the top comment for some extra explanation. It also rebases on master so the concerns about a confusing "beta" section shouldn't be there anymore @emdupre !

The number of files changed is much bigger now because we needed to make sure a title was contained in each content file. Now we no longer specify the title for any pages manually in the TOC, they're all inferred from the content folder

@choldgraf
Copy link
Member Author

Gonna merge this in and see how it looks in production. We can tweak titles / authors as needed, happy to discuss more

@choldgraf choldgraf merged commit 7b05324 into executablebooks:master Oct 22, 2019
@choldgraf choldgraf deleted the title branch October 22, 2019 18:56
@joergbrech
Copy link
Contributor

Does this feature exist with the new backend? If no, is this planned at all?

@choldgraf
Copy link
Member Author

choldgraf commented May 13, 2020

It’s not there now, I think it could be added back in but it will take a bit of thinking. Feel free to open an issue

@joergbrech
Copy link
Contributor

Ok, thanks! I just wanted to know whether it still exists, it's not superimportant to me.

@davidorme
Copy link

Likewise - I can always add page authors as text in a page but would be good to have this option. I'm assuming the 'new backend' is what is used in Jupyter Book: 0.8.3.

@choldgraf
Copy link
Member Author

Yep - this isn't currently possible, but here is an issue to track adding an "author" to pages: #1098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants