When I discovered MarkDown I was in love, it was very nice to discover an easy, clean, well-thought-out markup language. I wanted a way to be able take my detailed notes, have them easy to read, and then to be able post them here on the blog that would be in a nice WordPress format. Yesterday, I wrote about discovering
pandoc which enables a person to write in markdown and have it converted to HTML. To be able to use the HTML code created by
pandoc in WordPress it needed to be slightly edited and cleaned up. Therefore,… I created a bash script for it.
Example conversion from MarkDown format to WordPress format
It works pretty good. Basically it removes tags for paragraphs (
<p>), cleans up code blocks, improves formating, as well as doing a few other things. I haven’t gone through all permutations that pandoc conversion can do so a few thing swill be left out, but otherwise it should work for most things. If anything needs to be added please let me know.
I’d been looking for a way to convert my notes to webpages. Typically I wrote my notes in
.txt form and then went through them and added links, formatting… when I was ready to blog them. Recently, I had asked StackOverflow if I could convert MediaWiki format to HTML. I’m an Administrator for the Arch Wiki so I’m very familiar writing this format. This is when I learned about
pandoc. Pandoc’s author describes pandoc as, “If you need to convert files from one markup format into another, pandoc is your swiss-army knife…“.
Plain Text Example
I planned to write my notes in mediawiki format and then convert to HTML, however I’d been using StackOverflow lately and started to learn Markdown Prose and really like it. Markdown’s is designed to be easy to write and read: “Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML)“. Markdown is so easy to write that it makes sense that sites like StackOverflow and GitHub are using it.
Markdown, Markup Languange
Pandoc has extended markdown to use code blocks
```, tables, and a few other things and converting is very basic:
pandoc file.md -o file.htm
I’m in love, I’m in love, I’m in love :), as it will save me a good bit of time in editing/creating Documentation. Tomorrow, I’ll post a bash script to clean up the HTML to be able to put it in a WordPress Blog.
Warning: I got the base design from a Google+ website. I’m not sure if these are tradmarked logos and if Google in that case if they will have a problem with them. If they do, they will be removed.
I was hoping to use this for a Gmail notification icon but it didn’t turn out that way. I saw the Gmail icon but I couldn’t find it in scalable form, so I rebuilt it. Turned out pretty good. It’s under the CC license so be free to use it, however if you like to use it in a program please ask me and give attribution. Download.
Gmail – Unread (Symbolic)
Gmail – Read (Symbolic)
I wanted a way to easily download source files for quick editing. Sure
abs and numerous AUR-helpers do it but I wanted a simple all-together program/script that could do it, and it turned out to be pretty easy. I wanted to be able to define the repository, and then the package and I did it!
aur/ can be used here as well as the other repositories. I set up
$XDG_CONFIG_HOME/cower/config to use my pkgbuilds directory
TargetDir = /home/todd/.arch/pkgbuild/aur respectively) so it looks pretty nice:
aur extra own testing
If the repository is wrong it will list the available repositories:
Not a valid repository:
And it’s nice and it’s basic:
I created this because I liked the legacy logo and was inspired by Encelo’s Arch toon logo. It needs help on the gradient. To do a curved gradient, I had to rely on a blur (because Inkscape does not appear to be able to do curved gradients) and it bleeds a bit. But otherwise, I think it turned out pretty good. Under the CC license so be free to do what you want with it.
This one is not as important as the
pacman related script but I find I use it often too. I maintain several packages in the AUR and it comes in handy to quickly refer to common tasks related to
makepkg. The md5sum function still needs a bit of work (i.e. it requires the build function in the PKGBUILD be able to place the md5sums nicely). Otherwise it’s pretty ready. Here’s what it does:
mp <option> - common makepkg building tasks
b - build package (install dependencies if required)
m - update md5sums
r - remove previous build directories
s - create source files for upload, prompts for submission to the AUR
t - create PKGBUILD template
I once saw a wrapper-script for
pacman in the forums that was basically a short-hand version of common
pacman tasks. Over the last couple years, I’ve expanded on it. It does just about everything I need it to and its real basic. I call it
pm and here are the tasks it covers:
pm - pacman management tasks:
1 | oneshot - install package(s) as a dependency
c | clean - cleans package cache of packages no longer installed
d | depclean - remove dependencies no longer used
e | explicit - force package to be recognized as necessary
f | forcerem - force remove package (no dependency check)
i | install - install a package
l | list - list files installed by the package
o | owns - package that owns a file
n | info - information about the package
p | local - install package locally (a pkg.tar.gz file)
q | query - query for an installed package (Q for details)
r | remove - remove a package
s | search - search for a package
u | upgrade - sync database and upgrade system
y | sync - sync database
optimize - optimize database by placing files in order on disk
pkglist - create list of official and local installed packages
Good for me to have this around so I can remember everything :). AUR link.