Skip to content

How to create a new post

Holtz Yan edited this page Jul 29, 2023 · 1 revision

Here are the steps to follow to create a new post in the python graph gallery. Post suggestions are made through GitHub pull requests.

Thanks a lot for your contribution! 🙏


Step 1: Fork the repo

Fork the python graph gallery GitHub repository


Step 2: Add a new notebook

The best way to add a new notebook is to copy-paste one of the existing notebooks. They are all in the folder /src/notebooks/

Then you have to:

  • rename the file. All post names start with a number, like 199-matplotlib-style-sheets.ipynb. Please start yours with a number above 500. (find a number that is not taken yet). Keep the .ipynb extension.
  • modify the notebook content. See the page for indication on how to write a good blogpost
  • modify the notebook metadata. Do do this you have to open the notebook as a text file.
    • title: the main title that will appear in big at the very top of the blogpost
    • description: the first chunk of text that will appear under the title. You can use html here, so feel free to include some links and formatting.
    • family: must be be one of: evolution, ranking, distribution, general, correlation, partOfAWhole, flow
    • chartType: it must be one of the id used in this file.
    • slug: very important: must be the same as the file name, but without the .ipynb extension
    • keywords: will be passed to the html page header
    • seoDescription: will be used for the description header meta tag of the html page. So think about what google wants to know about your post. Text only.

Do not change anything else outside of those properties 🙏.


Step 3: Link your post from parent pages.

Let's say you wrote a post about an awesome box plot. You have to:

  • create a screenshot of this boxplot
  • include this screenshot in the boxplot.js parent page.

TODO: detail this


Step 4: Create a Pull Request

Create a pull request and I will check your work!

Clone this wiki locally