GithubHelp home page GithubHelp logo

markdown-review-tool's Introduction

markdown-review-tool

Markdownをプレビューしながらコメントをアノテーションとしてつけていくツールです。

screenshot

ただし、この単独のHTMLはあんまり使いやすくないので後述するcgmd-browserに組み込んだElectronアプリのほうが便利です。

  • 文章の任意の位置にコメントを書くことができる
  • 書いたコメントをJSONとしてコピーできる
    • MarkdownのSourceMapのような仕組みを持っているので、HTMLにつけたアノテーションからMarkdownの元ファイルにおける位置をとれます
/* 
{
    // 元Markdownにおけるposition
    "position": {
        "start": {"line": 145, "column": 33, "offset": 225231},
        "end": {"line": 145, "column": 37, "offset": 225235}
    },
    // 変換後のHTMLに対するアノテーション
    "annotation": {
        "id": 5,
        "annotator_schema_version": "v1.0",
        "text": "初回は--debugオプションの短縮形であると書いたほうが分かりやすいかも\n(以下にもデバッグ時に使うぞって感じ)\nhttps://github.com/substack/node-browserify",
        "quote": "-dオプションによるものです",
        "ranges": [{"end": "/p[28]", "endOffset": 44, "start": "/p[28]/code[2]", "startOffset": 0}],
        "uri": "http://localhost:9080/static/review/index.html",
        "filePath": "/path/to/test.md"
    }
}
*/

// JSDoc 的な定義
/**
 * @typedef {object} MarkdownReviewData
 * @property {{
 *   start: {line: number, column: number, offset: number},
 *   end: {line: number, column: number, offset: number}}
 * } position
 * @property {AnnotationData} annotation
 */

/**
 * @typedef {object} AnnotationData
 * @property {string} id
 * @property {string} text
 * @property {string} quote
 * @property {{end: number, endOffset: number, start: number, startOffset: number}} ranges
 * HTML range(not markdown range)
 * @property {string} annotator_schema_version
 * @property {string} uri
 * @property {string} filePath
 */

Usage

Electronアプリ

azu/cgmd-browserからダウンロードしてつかう。

プレビューがmarkdown-review-toolになるハックがされたforkです。

markdown-review-to-issue

コピーしたJSONデータを、Issueへコピーしやすいような形式にしたMarkdownを吐けます。 また、その内容のIssueを作るリンクを開いたりできます。

Workflow

  1. azu/cgmd-browserでMarkdownの文章を見ながらコメントを付ける
  2. Copy AnnotationsでJSONデータをコピーする
  3. markdown-review-to-issueでアノテーションをIssueとして立てる

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

markdown-review-tool's People

Contributors

azu avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.