Showing posts with label google drive. Show all posts
Showing posts with label google drive. Show all posts

Tuesday, December 17, 2013

StackEdit for Markdown (.md) in Google Drives ... kind of works


UPDATE 2014/01/22 later that day. -- it looks like it still works but there is now a checkbox in StackEdit settings that says "Markdown Extra/GitHub Flavored Markdown syntax". If it is ON, the HTML inside .md is ignored. If you UNCHECK it, it works as is described below.

UPDATE 2014/01/22 -- This kind-of-works has recently turned into does-not-work. StackEdit obviously stopped recognizing HTML mixed in with your .md text. I used to have pretty looking pages and now they all reverted to custom format. There could be a workaround -- possibly adding the STYLE tag into the templates in StackEdit setting. I will try that later.

====

Yep. Kind of works. Meaning that it does work entirely satisfactor... torrrily .. is that a word? ... but has some flaws when it comes to sharing.


Specifically, PROS:
--------------
- you can work with content which is viewable in browsers. Literally with HTML. You do not have to type in HTML because .md has some custom behavior based on some syntax you use in text (do a search on markdown), but if you do type in HTML it will interpret it correctly;
- it is easier when writing notes (meeting minutes, manuals, etc.) when its closest rival -- Word, including the one in Google Drive. I hate to type docs I create on the fly in Word. See the example below for an example *pretty doc*.
- Print-to-PDF is excellent! Keeps all the formats, colors, etc. These docs are pretty!


Now, CONS:
----------
- a bit sluggish because it is not native to Google Drive
- viewing mode is one button away but the default is a split screen (input versus WYSIWYG) -- not good when you share your doc with others
- sharing is painful. Even if your share-ees have Google accounts, they have to walk through the installation process to enable StackEdit on their accounts. The biggest pain is that people who do not have Google accounts cannot view your .md docs ... at ALL. I still get a couple of those among my friends. Ended up creating a PDF for the file and sharing that.


Now, this blog is on a specific topic related to .md files. Default .md behavior is not what you might expect. For example, H1 is too big with huge margins, there is no italic, now underlined text, etc. However, including a small STYLE section at the beginning of your .md file will take care of all that. Think of this as a FORMAT stab which you an copy across a subset of your documents.

Here is mine:

STYLE -- enclose in angle braces as is normally done in HTML
em { font-size:larger; font-weight: bold; font-style: normal; text-decoration: none; }
strong { font-size:larger; font-weight: bold; text-decoration: underline; }
h1 { margin: 20px 0px 5px 0px; font-size: 20px; font-weight: bold; background-color: #ccc; padding: 3px 0px; }
h2 { margin: 20px 0px 5px 0px; font-size: 20px; font-weight: bold; background-color: #f00; padding: 3px 0px; color: #fff; }
code { background-color:#ccc; }
hr { border: 1px solid #999; margin: 5px 0px 10px; }
/STYLE


It looks like this in on the left size of your StackEdit:

And like in WYSIWYG on the right side (one of my current docs):


The syntax the style of which I altered is:
1. `code`
2. *stress*
3. **more stress**
4. # normal header/section
5. ## red header / section

For the rest of default syntax see a Markdown howto.


Tuesday, October 1, 2013

Markdown as a Native Google Drive Doctype

I have been maintaining some presence in GitHub for awhile now. For those who know, GitHub -- among many other programming-related portals -- uses .md aka Markdown format for readme files. Markdown is really handy for structured text. In fact, I prefer it to a Word file.

Now, let's say that you want to work on a file within a community. For this you would normally share a file -- say, make it public in your Google Drive -- and let other people edit it on their side. Works just fine with all the traditional Google Drive formats. Not with .md files until now.

Actually, this is a lie. Apparently, Google Drive DOCTYPES can be extended. See this:



That StackEdit doctype in the list is what I found in the list under "Connect More Apps". There list of special doctypes is very list, actually. I did not really look at all the others.

It is a bit weird on the first run -- that's when you have to be careful to allow popups and let StackEdit initiate the 3-way OAuth handshake to become an authorized app for your GoogleDrive, but after that it will work the same as any other application. Except it is closer to a WYSIWYG HTML editor because the concept of input is that of a markdown, by definition.

The problem of sharing your .md files with people who do not have Google accounts remains unsolved. It is possible with native doctypes but .md (actually, x-markdown mime) will require you to log in and install the application (3-way handshake needs an account).

So, summarizing

(1) StackEdit as native doctype in Google Drive -- OK
(2) .md files shared publicly for community edits (sharing) -- OK
(3) Sharing with people who do not have Google accounts -- FAILED


Home the (3) becomes possible is the future.