Automatically add a YAML Front Matter in Typora - yaml

I am using Hexo to post my blog online and Hexo requires me to include a YAML Front Matter in my .md file so it can render the title in my online blog.
Manually adding the YAML Front Matter title file is tedious. How can I automatically generate the title according to the name of the .md file?
Like when I create a Managing dependencies.md file, Typora would automatically add the title: Managing dependencies YAML Front Matter as I open it for the first time. Or is there any script that enables me to use only a single shortcut to generate it?
enter image description here

Related

Sphinx contents search results

I am currently using the read the doc theme for sphinxdoc version 1.4.6. When I search contents the queries display the title and the start of restructure text files instead of the the title and start of the html page. Is there any possible way I can change that?
Try the sphinx extension "sphinxprettysearchresults" (https://pypi.python.org/pypi/sphinxprettysearchresults).
Their website says this:
To display search results, Sphinx is fetching the source files of search hits and rendering excerpts in raw markup (Example).
This extension removes the markup from these source files (during build time), so the search results look decent.
However, when I load it on my project, I get an error, which I will have to report.
Maybe it works fine in your project.

How to extract blog posts from Ghost and import in Github hosted jekyll?

Jekyll website has given this instruction but it's not complete. I downloaded ghost.db from ghost blog and Installed http://import.jekyllrb.com/docs/ghost/ and jekyll-import gem and it's all dependencies. and ran the given command in above link. It ran but it's giving error
Also I don't have any local installation of jekyll website. It's hosted on github.
I want to move my blog posts of ghost to github hosted jekyll.
My OS is OSX Yosemite.
You have to run your command from the folder where ghost.db is in.
If your not lauching your command from the db folder, you can give an absolute path like
"dbfile" => "/home/user/ghost.db"
Or the database name is not the good one. Maybe ghost-dev.db or ghost-prod.db.
Another option is to export your ghost blog to json and then convert that json file into markdown files for Jekyll GitHub pages.
The json file is pretty self explanatory, so you could write a simple program to parse the file and create markdown files from it.
The process would look like this:
read the json file into memory.
parse the posts from db.data.posts.
for each post:
the markdown content is in the post markdown property.
create your front matter from the other post properties.
write a file with the front matter and original markdown, pre-pending the file name with the date into a _posts folder in your output folder.
note: if the page property is 0, it's a post, if it's 1 it's a page. If it's a page, the file should go in the root of your output folder without the date in the file name.
Each post file should look something like this:
---
layout: post
title: Welcome to Ghost
permalink: /welcome-to-ghost
date: 2017-04-25 20:54:20
published: false
tags:
---
You're live! Nice. We've put together a little post to introduce you to the Ghost editor and get you started. You can manage your content by signing in to the admin area at `<your blog URL>/ghost/`. When you arrive, you can select this post from a list on the left and see a preview of it on the right. Click the little pencil icon at the top of the preview to edit this post and read the next section!
If you're looking for an existing utility, or sample code, try GhostToGitHubPagesConverter. It's a dotnet core console app that will run on windows, mac or linux.
Full disclosure, this is my github project.

Is there software I can use to view my Markdown files as a wiki, with relative links, on Windows

Our team has installed the Markdown Mode extension in Visual Studio on our Windows PCs, and we're happy with that as an editor for Markdown files, but we need a way to generate a wiki from those files where we can click on links that cross-link the files of the wiki. I've been trying to find something, but haven't had any success getting something running.
I tried creating an empty web application and pasting in the html file from here http://dynalon.github.io/mdwiki/#!index.md and naming it index.html, and adding a couple of md files to the same directory that I set to always copy to the build directory, but I got 404-3 errors when it tried to access the .md file.
I see a couple of tools that look possibly good but need Python or Ruby installed, which isn't ideal: http://markdoc.org/quickstart or http://helloform.com/projects/commonplace/
I see this ASP.NET control for embedding a Markdown file into a page http://wikicontrol.codeplex.com/ but the control is for VS 2010 so clearly is not being actively maintained, plus to use it I'll need to build something to take the relative links and find the related .md files and load them up in MVC - sounds like a hassle to get working, and it will require me to put MVC in my docs project.
Is there something that is just designed so that I can put an html file or similar in a directory with a root .md file and have it just immediately act like a wiki and allow navigation between them?
We have decided to use MarkdownDeep NuGet package and a single MVC controller to handle this. The MVC controller looks at the requested path, uses it to figure out the location of the Markdown file, reads that file and renders it to HTML and returns the HTML.

How to change extension of files generated by Jekyll?

How to generate not *.html files with Jekyll but files with another extension? I would like to patch it with rb plugin. Is it possible?
I tried this (googled this), but it doesn't work:
module Jekyll
# Extensions to the Jekyll Page class.
class Page
def output_ext(ext)
".myext"
end
end
end
If you want an output to _sites/ with your extension “from the box”, you can use only pages files — they're not using the permalink from the config, so those files would have the same extension you gave to them.
So, the smallest set is a file page.my-ext at the root of your project, having a YAML front matter (could be empty) like this:
---
---
Foo
Such file would be visible to the Jekyll, you could use any liquid markup inside, or use any layout for it, and then this file would be saved to the _sites/ with the same name it was before.
You can't use such file in /_posts/, 'cause when there is a permalink set, Jekyll saves files only as .html.
Custom plugin with converter works for me, but also only for simple pages — posts from /_posts/ are still getting .html, so it seems that it's hardcoded there.
So, the only way right now is to use simple pages instead of posts. And if you'd like to iterate through all such pages as you can do with posts, you should read on how the pages_list module from Jekyll Bootstrap is made — I think it's something like that.
EDITED:
Sollution found here:
http://jekyllrb.com/docs/permalinks/
You can specify the permalinks in the markup post. It will unfortunately not work if specified in _config.yml
According to my tests, if you enter:
permalink: /whatever/filename/with/arbitrary.xtension
in the markup post, your index file will be named "arbitrary.xtension" and placed in the folder:
/whatever/filename/with/
For other applications where the content of the file needs to be consistent to the extension, this plugin might perhaps help you:
https://github.com/fauno/jekyll-pandoc-multiple-formats

How can I create a download link in octopress

I'm using Octopress for my blog and need to create a link to download a text file.
There is a built in plugin called include_code that renders a link but also shows the file. I just want the link. Does anyone know how I can do this?
Put your text file under source/downloads/code
Then you can use the markdown syntax for showing links like this :
[link name](url for the txt file)
The url will be {your blog url}/downloads/code/{name of txt file}
This is derived from the include_code plugin which also shows a download link for each code listing.
UPDATE :
To do it from within HTML, you can use
Text File

Resources