https://github.com/coxley/quip2md
Library and CLI to convert Quip HTML to Markdown
https://github.com/coxley/quip2md
Last synced: about 2 months ago
JSON representation
Library and CLI to convert Quip HTML to Markdown
- Host: GitHub
- URL: https://github.com/coxley/quip2md
- Owner: coxley
- License: mit
- Created: 2018-10-03T17:49:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-03T20:18:30.000Z (over 7 years ago)
- Last Synced: 2024-08-01T03:32:50.149Z (over 1 year ago)
- Language: Go
- Size: 22.5 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- stars - coxley/quip2md
README
# quip2md [](https://godoc.org/github.com/coxley/quip2md) [](https://travis-ci.org/coxley/quip2md)
Quip is a cloud documentation suite which provides a web API for interacting
with it. While the UI has export options for different formats, it all happens
client-side. The API only returns HTML which is heavily customized to work with
their styling. Unfortunately this means no markdown converter knows how to
act when processing.
There's an [existing issue](https://github.com/quip/quip-api/issues/8) on the
[quip-api](https://github.com/quip/quip-api/) repo but it doesn't seem to be a
priority. That's where `quip2md` comes in!
## Supported Features
* Headers 1-3
* Bold
* Italics
* Underline [*]
* Strikethrough [*]
* Inline Code
* Hyperlinks
* Unordered Lists
* Ordered Lists
* Checked Lists w/ check marks maintained
* Nested lists w/ a-z and roman numerals on unordered lists
* Quote Blocks w/ maintained text styling
* Code Blocks - including adjacent ones
### Caveats [*]
* Not every Markdown renderer supports underline the same way. We use `_this_`
* Not every Markdown renderer supports strikethrough. We use `~~this~~`
* Highlighted text will be converted with no styling applied
## Download
```shell
go get -u github.com/coxley/quip2md/...
```
## Usage
`quip2md` can be used as both a library in your Go program or from the CLI.
This is done to enable any project regardless of implementation language to
take advantage
If you're using the [go-quip](https://github.com/mduvall/go-quip) library,
usage might look like the following:
```golang
package main
import (
"fmt"
"github.com/coxley/quip2md"
quip "github.com/mduvall/go-quip"
)
const quip_token = "YOUR_API_TOKEN"
const quip_ref_doc = "EXAMPLE_DOCUMENT_THREAD_ID"
func main() {
q := quip.NewClient(quip_token)
thread := q.GetThread(quip_ref_doc)
md, _ := quip2md.QuipToMarkdown(thread.Html)
fmt.Println(md)
}
```
From the CLI:
```
$ quip2md --help
NAME:
quip2md - Convert Quip HTML to Markdown
USAGE:
quip2md [file to convert]
cat [file to convert] | quip2md
custom_program | quip2md
```