First 2 weeks of GSoC in a nutshell
I just can’t believe that 2 weeks already passed ! I have struggled to understand the Sphinx and how to implement it as a static website. It was a little bit painful period for me to build a website in such a way that almost no one ever used Sphinx as a basis of these kind of websites.
At the very first days, I tried to learn the directory structure of Sphinx. I think this is the most important part for someone who wants to use Sphinx. I organized all my folders and the files in the given order by reading Sphinx’s documentation. The source directory includes mainly 2 directories like _static, and _templates. I read that it is recommended to put underscores before the folder name to be able to host the website on Github with no worries -since Github supports Jekyll and we hate it !!- In the _static folder, I put all my static files such as png files, and my custom css file. In the _templates folder, I created a layout.html file and this is our *master file* ! All the other html files extends from this file. When templating with Sphinx, I use Jinja2 templating engine for the layout file. Jinja is really powerful and it is very similar to Django.
I started with overriding the footer in layout.html file. Then I customized the navbar and tried to make it look cool. Here is how the SunPy website looks at the 1st day :
I analyzed the codes of some Sphinx docs and my mentors was really supportive during my learning process of Sphinx. They always try to help me and show a really good understanding in all cases. Every day, I showed the progress to them and they appreciated my work and we tried to enhance it together.
Later on, I developed my skills on Sphinx and now I’m way more comfortable with that. I’m currently working on the navbar sections. Sphinx uses restructuredtext as its markup language. When I want to style some parts more, I use raw html in restructuredtext. It embeds the html and you can do whatever you want in it. I guess one of the most tiring side of Sphinx is that you have to target the correct css classes to override and do it properly. After some customizations, currently SunPy website looks like :
I hope everyone likes my work and I can complete the website fully in Sphinx ! This feels really good to contribute to open source and for an astronomy project, awesome !!