Name: gdocs2md-html
Owner: Open-Science-Training-Handbook
Description: Convert a Google Drive Document to a markdown.
Created: 2018-02-16 11:43:13.0
Updated: 2018-02-16 11:43:14.0
Pushed: 2018-01-30 08:43:58.0
Size: 92
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A simple Google Apps script to convert a properly formatted Google Drive Document to the markdown (.md) format.
Ctrl
/?
+ S
)Note: now needs advanced Drive API enabling in Script Editor on first use (just a few clicks from the menu).
Resources
menu ? Advanced Google Services
, enable the Drive API by clicking the switch next to its nameCtrl/Cmd
+ S
to save it, select onInstall
from the functions dropdown menu at the top of the page and to the left of that click the play icon to run.Markdown
menu will be sitting there, with a dropdown to Export markdown
> View in browser
Menu added to Google Docs. Note: customisation/comments features work in progress, see script
When you finish writing, the markdown (via the View in browser
button) can be pasted straight into a suitable publisher.
--- src
… ---
fences could demarcate <blockquote>
/ </blockquote>
tags - you're free to edit the script when installing.Related tips/tricks:
devnotes: Custom application to open .gdoc extensions (unix)
Running the script:
setupScript
from the script editor's dropdown menu and the play symbol button (on the left of the dropdown) to run itconvertSingleDoc
function, or for batch processing on a folder use the convertFolder
function./assets/images
).text
[anchortext](url)
>
(blockquote
) blocks<sup>
/<sub>
)*
” Markdown format appropriately, including nested lists[[TOC]]
<pre class="whateverclassnameyouwant"></pre>
<pre></pre>
<pre class="prettyprint"></pre>
<pre class="glossary"></pre>
<pre class="fig-cap"></pre>
(figure captions)<table>
processing<testID>
” is replaced by an iframe that shows an interactive chart of a JSPerf test. The <testID>
is the last part of the URL of the Browserscope anchor in your JSPerf test. Something like "agt1YS1wcm9maWxlcnINCxIEVGVzdBjlm_EQDA"
in the URL http://www.browserscope.org/user/tests/table/agt1YS1wcm9maWxlcnINCxIEVGVzdBjlm_EQDA
Use this script at your will, on any document you want and for any purpose, commercial or not. The MarkDown files generated by this script are not considered derivative work and don't require any attribution to the owners of this script.
If you want to modify and redistribute the script (not the converted documents - those are yours), just keep a reference to this repo or to the license info below:
right 2013 Google Inc. All Rights Reserved.
nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.