You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-17Lines changed: 35 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,49 @@ gdocs2md
4
4
A simple Google Apps script to convert a properly formatted Google Drive Document to the markdown (.md) format.
5
5
6
6
## Usage
7
-
* Open your Google Drive document (http://drive.google.com)
8
-
* Tools -> Script Editor. Ignore (close) if you see a popup, clear the myFunction() default empty function and paste the [converttomarkdown.gapps](https://raw.github.com/mangini/gdocs2md/master/converttomarkdown.gapps) contents into the code editor
9
-
* File -> Save
10
-
* Run -> ConvertToMarkdown (First run will require you to authorize it. Authorize and run again)
11
7
12
-
The converted Markdown will be immediately sent as an attachment to your email. Images will be attached as well.
13
-
14
-
You can run the script again in the same document whenever you want, just clicking in Tools -> Script Manager -> Run. Every run will send a new email.
8
+
* Adding this script to your doc (once per doc):
9
+
* Open your Google Drive document (http://drive.google.com)
10
+
* Tools -> Script Manager > New
11
+
* Select "Blank Project", then paste this code in and save.
12
+
* Clear the myFunction() default empty function and paste the contents of [converttomarkdown.gapps](https://raw.github.com/mangini/gdocs2md/master/converttomarkdown.gapps) into the code editor
13
+
* File -> Save
14
+
15
+
* Running the script (run as many times as you want):
16
+
- Tools > Script Manager
17
+
- Select "ConvertToMarkdown" function.
18
+
- Click Run button (First run will require you to authorize it. Authorize and run again)
19
+
- Converted doc with images attached will be emailed to you. Subject will be "[MARKDOWN_MAKER]...".
15
20
16
21
17
22
## Interpreted formats
18
-
**NEW*: Numbered lists are converted correctly now, including nested lists
19
-
**NEW*: images are correctly extracted and sent as attachments
20
-
**NEW*: Table of contents is replaced by `[[TOC]]`
21
-
* paragraphs are separated by two newlines
22
-
* text styled as heading 1, 2, 3, etc is converted to Markdown heading: #, ##, ###, etc
23
-
* text formatted with Courier New is backquoted: ``text``
24
-
* links are converted to MD format: `[anchortext](url)`
25
-
* bullet lists are converted to "`*`" MD format appropriately, including nested lists
26
-
* blocks of text delimited by "--- class whateverclassnameyouwant" and "---" are converted to `<div class="whateverclassnameyouwant"></div>`
27
-
* blocks of text delimited by "--- source code" and "---" are converted to `<pre></pre>` and prefixed by 4 empty spaces
23
+
* Text:
24
+
* paragraphs are separated by two newlines
25
+
* text styled as heading 1, 2, 3, etc is converted to Markdown heading: #, ##, ###, etc
26
+
* text formatted with Courier New is backquoted: ``text``
27
+
* links are converted to MD format: `[anchortext](url)`
28
+
* Lists:
29
+
* Numbered lists are converted correctly, including nested lists
30
+
* bullet lists are converted to "`*`" Markdown format appropriately, including nested lists
31
+
* Images:
32
+
* images are correctly extracted and sent as attachments
33
+
* Blocks:
34
+
* Table of contents is replaced by `[[TOC]]`
35
+
* blocks of text delimited by "--- class whateverclassnameyouwant" and "---" are converted to `<div class="whateverclassnameyouwant"></div>`
36
+
* Source code:
37
+
***UPDATED**: blocks of text delimited by "--- source code" or "--- src" and "---" are converted to `<pre></pre>`
38
+
***NEW**: blocks of text delimited by "--- source pretty" or "--- srcp" and "---" are converted to `<pre class="prettyprint"></pre>`
39
+
* Tables:
40
+
***NEW**: Simple `<table>` processing
28
41
* "--- jsperf `<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`
0 commit comments