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

ENH: add next and prev metadata #317

Open
mmcky opened this issue Feb 18, 2020 · 8 comments
Open

ENH: add next and prev metadata #317

mmcky opened this issue Feb 18, 2020 · 8 comments

Comments

@mmcky
Copy link
Contributor

mmcky commented Feb 18, 2020

Currently we don't pass next and prev document metadata. This is something used a lot in core sphinx themes.

@jstac
Copy link
Contributor

jstac commented Feb 18, 2020

Something to work on while @DrDrij is here?

@mmcky
Copy link
Contributor Author

mmcky commented Jun 9, 2020

hey @DrDrij I think we can fix this pretty easily on the sphincontrib-jupyter side.

Can you let me know what you need as the metadata format

nb.metadata.next = (link, title-text)
nb.metadata.previous = (link, title-text)

@DrDrij
Copy link
Member

DrDrij commented Jun 10, 2020

@mmcky That looks perfect. Access to title and link is all I need.

@mmcky
Copy link
Contributor Author

mmcky commented Jun 10, 2020

@DrDrij can I give you the following meta data sample?

 "metadata": {
  "date": 1591752665.62833,
  "filename": "about_py.rst",
  "kernelspec": {
   "display_name": "Python",
   "language": "python3",
   "name": "python3"
  },
  "next_doc": {
   "link": "getting_started",
   "title": "Setting up Your Python Environment"
  },
  "prev_doc": {
   "link": "index_learning_python",
   "title": "Introduction to Python"
  },
  "title": "About Python"
 },

this should be:

  1. relative uri (without the html postfix added)
  2. title of that document

it will be convenient to not have html hard coded in case we need to reference an ipynb later on etc.

@DrDrij
Copy link
Member

DrDrij commented Jun 10, 2020

I can work with that :)

@mmcky
Copy link
Contributor Author

mmcky commented Jun 10, 2020

last question - if there is no previous or next document would you rather

missing metadata (i.e. no previous_doc as a key in the notebook metadata)
OR
some value to indicate not applicable

@mmcky
Copy link
Contributor Author

mmcky commented Jun 10, 2020

the current index metadata is

 "metadata": {
  "date": 1591753649.837961,
  "filename": "index.rst",
  "kernelspec": {
   "display_name": "Python",
   "language": "python3",
   "name": "python3"
  },
  "next_doc": {
   "link": "index_toc",
   "title": "Table of Contents"
  },
  "title": "Python Programming for Economics and Finance"
 },

@DrDrij
Copy link
Member

DrDrij commented Jun 10, 2020

That works @mmcky - I will enter an if clause to check whether prev/next exist.

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

No branches or pull requests

3 participants