Using Restructured Text in Nikola My Tweaks and Tips

/images/2018/rest/screen.thumbnail.jpg

So I've started to use ResSructured text to write my posts instead of markdown as it is just as quick as markdown and it's easier to use more of the native features in nikola like shortcodes and plugins. The ReStructured text documentation covers most things, but to have a greater amount of contril over my posts I needed to use the following tweaks. So here are my tweaks and tips when writing in Restructured text in Nikola with a bit of HTMl and Nikola's Python shortcodes thrown in.



Add html into your posts

At times you might want to add some html directly into your posts, if you wanted to embed an iframe for example. In Nikola their seems like there is more than one way of doing things. If it was something you wanted on lots of pages you'd set up a template; but if it is a one off and you wanted to embed html into one post, you could add in the following code.


 .. raw:: html 
   
<embed>
...
</embed>

Add a blank line when using ReStructred text

If you regularly want to change the padding of your page, you're better off changing the css in the theme. But if you're a beginner (like me), lazy (like me) or only want to do it once, you can add in a blank line by using a 'pipe' character.

|

Using # to link to a section of a post

This can be useful if you want to direct people via an external link to a section of your post.

So if I have an internal link already set up (like post above) the hyperlink will be the normal page address and then #link_name and that can be used as an external link that will take you to the section of a page. for example:

https://neilharrison.me/posts/restructured-text/#post

Use alignment with the images and thumbnail shortcode

  .. thumbnail:: /images/image.jpg
                   :align: left
   

Footnote

You might end up here!

Emojis

🎵 💲 🛂

/images/2018/emoji/emoji.thumbnail.jpg

I know that this site supports emojis/emoticons (what ever you call them?), but the Nikola documentation doesn't really make it clear all the possible emojis that you can use, so I did some investigation (it was there somewhere on Github, but hidden away). You write the emojis using these shortcodes:

😢 🚫 😵

 {{% emoji crying_face %}}   {{% emoji no_entry_sign %}}     {{% emoji dizzy_face %}} {{% emoji eight_pointed_black_star %}} 

It turns out that a lot of different possibilites are supported and here's a list of some of the different codes. Note that in the examples above you need to take out the colons.

The next problem I had is that these codes didn't seem to work with single word emojis like this:

 {{% emoji smile %}}{{% emoji wink %}} 

I'm not sure if it is a bug or I just haven't worked out the correct syntax? So then I tried just copying and pasting the emojis themselves into my text editor and it turns out that also works 😊 😉.

It's also worth bearing in mind that Nikola isn't a big fan of repeated emojis ☹️ ☹️ and you might get an emoji 🦃 warning.

Now you can add emojis to all your Nikola posts. 👍

Ebook Tools

Ebook Tools For The Classroom

Book creator Story Jumper
Last year I wanted to create some ebooks with my class, to help them write for a purpose and share them with a wider audience. I've dabbled with ebooks in the past, but I've often been too ambitious and made them to complex and we've failed to finish them in time or I haven't shared them with a wider audience. So I've been looking at the following options for an easy to use ebook creator and have tested them with my previous class. There's a great number of ebook tools that are available, but if you look only at the child-friendly application the list soon narrows down. Here are the criteria I used to narrow my search.

Read more…

How I set up and Customised my Site

Setting up with the Nikola Framework

Here is my down and dirty guide to what I did to create a static site and some of the many tweaks that followed. Mainly so I can remember what I did if I need to redo it again. I'm an amateur at this, so I'm not saying this is the best way to do it.

Introduction

One of the key criteria for my site setup is that it is easily transferable so I'm not tied into a hosting platform and can get the best value deals, as I don't want to pay much for a personal site that is essentially a hobby. True I could use a free platform like Blogger, but I want the flexibility of being able to fully understand and customise my website. Additionally, if Blogger ever shuts down (Not an unlikely prospect as Google has shutdowna lot of services in the past) I don't want to have a problem exporting a large amount of information. For that reason an independent platform suits me and my choice is Nikola, which isn't the easiest p;atform for a non coder like me, but easy enough for to get a site working and the challenge means I've learnt a lot through this process. My site is also static, which means that it is all essential a few files and doesn't have the databases etc of most websites. The advantages are that it loads fast (except for any external iframes), it's very secure and won't get viruses. It means I can work completely off line. This is useful when I'm travelling and I want to write a post and now when I'm writing this article is a power-cut. So below is my generic setup so I remember what to change next time.
Computer desk

Read more…

The land of the dragons

Flores and Komodo National Park is fast becoming popular with divers and tourist alike. It's as close as you can get to visiting Jurrasic Park, If you get the chance go their now before all of the other tourists get there. Here is what I got up to.

/images/2017/komodo/island1.thumbnail.jpg

On the boat passing the Islands of Komodo National Park

Read more…