Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Collaborative markdown with math

License

NotificationsYou must be signed in to change notification settings

cben/mathdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Online collaborative markdown with math. Main features:

  • Markdown is styled in-place, no source/preview separation.
  • Edits are synced in real time.
  • Access control is simply by sharing the secret URL. No sign up needed to collaborate.
  • LaTeX-syntax formulas rendered in-place when cursor is outside formula.

Powered byCodeMirror,MathJax andFirebase'sFirepad.I'm using "CM" = CodeMirror, "MJ" = MathJax abbreviations a lot in the project.

Alpha quality – will eat your math, burn your bookmarks & expose your secrets.I mean it. See for example#85 — saving would sometimes be silently broken, forhalf a year! I'm working to make it more robust (and tested) but for now, be careful.

Issues:mathdown HuBoardCodeMirror-MathJax issues

License

My code is underMIT License.Exception: font/ contains a subsetted Bitstream Charter font under a permissive license - seefonts/LICENSE.

Dependencies:

  • CodeMirror is also MIT.

  • MathJax is under Apache License 2.0.

  • MyCodeMirror-MathJax glue is also MIT.

  • The collaborative editorFirepad is MIT. It calls firebase javascipt API.

  • Firebase is aproprietary service; their client-side javascipt APIfirebase.js is alsoproprietary, though apparently fine to distribute in practice — (#4).[firbease.js has beenaccidentally MIT-licensed for a time but I've upgraded to newer versions so this doesn't apply.]

    I'm not including firebase.js directly but using it as a git submodule.

Document hosting and privacy(?) on Firebase

All user data is stored in Firebase, now owned by Google.Their privacy policy.Documents access (read AND edit) is by secret document id which is part of the url. This is grossly unsecure unless using HTTPS.

The downside is users can't really control their data. Running a "self-hosted" copy of the site still leaves all data in the hands of Firebase. See #4 for more discussion.

The upside is all forks interoperate; you can change the design or tweak the editor and still access same documents. E.g.https://mathdown.net/index.html?doc=demo andhttp://rhythmus.be/mathdown/index.html?doc=demo look different but access the same doc -- and real-time collaboration between them works!

I'm so far on thefree Firebase plan - 100 devices (not sure if 1:1 with users), 1GB Data Storage (used < 100MB). => Will need 49USD/mo plan as soon as I get non-negligible usage.https://mathdown.firebaseio.com/?page=Analytics (only visible to me)

Deletion is impossible

The current Firebase security rules make document history append-only. That's a nice safety feature but it means that once a document's URL gets out, it's full history is forever accessible to the the world. This must change eventually (#92).

Browser support

Basically whatever CodeMirror supports: IE8+ and about everything else.But mobile is currently almost unusable (#81).

JavaScript is required (and this includes running the non-Free firebase.js in your browser).You can't even read documents without JavaScript; reading won't be hard to fix (#7) — but editing documents without JavaScript is implausible (I plan to settle for append-only form).

Cookies

The only cookies I'm aware of:

  • mjx.menu cookie set for a year(?) if you manually change MathJax settings.

I'm not sure Firebase never sets cookies. Things will change once I implement login (#50).

Installing dependencies

Dependency StatusdevDependency StatusGreenkeeper badge

  1. After checking out, run this to materialize client-side dependencies:

    git submodule update --init --recursive

Append --remote to upgrade to newest versions of all submodules (need to commit afterwards if anything changed). Known constraints on updating all deps:

* firepad only includes pre-built dist/firepad.js in tagged versions (after every release they strip it back).* [CodeMirror-MathJax currently doesn't support MathJax 2.5](https://github.com/cben/CodeMirror-MathJax/issues/33).

(I'm directly working ingh-pages branch without amaster branch. GH Pages automatically resolves https://... submodules. It's no longer the primary hosting but it's still useful to test the static version works.)

  1. To install server-side dependencies (and devDependencies) listed inpackage.json run:

    npm install

(But when deploying to RHcloud or Heroku, npm install might run in--production mode and devDependencies won't be available.)

To see whether any updates are needed/possible, runnpm outdated. To update run:

npm update --savenpm shrinkwrapThen commit the new `package.json` and `npm-shrinkwrap.json`.

TODO: find way to use samenode.js version in dev and prod?

Test(s)

Travis test runnerSaucelabs browser tests

test/browser-on-saucelabs.spec.coffee runs tests on several browsers using free browser testingcourtesy of Sause Labs.There are pathetically few tests.

To run the tests:

npm install  # oncenpm test

To run only some tests and/or browsers, use:

./node_modules/.bin/mocha --grep firefox

The test runs automatically on any commit and pull request.I've tried several free services for this, and currently prefer Travis:

  • Travis - works, open source code. Controlled by.travis.yml.
  • Wercker - works. Controlled bywercker.yml.
  • Drone - Docker-based,open source rewrite in progress. Alas, always timed out during test. Test config on the web.
  • Shippable - builds history only accessible by me? Bad, I want public. Controlled by.travis.yml.
  • Codeship - same, dashboard is private. Test config on the web.

Where it's deployed and how to run your fork

The main deployment currently runs on Heroku. Seedeployment/ subdirectory for details. I'm interested at going back to static hosting.

However you run it, you can open the same document ids (doc=...) and real-time collaboration will work!

Quick ways to run:

Deploy on Heroku:

heroku create my-mathdown --remote heroku-my-mathdowngit push heroku-my-mathdown gh-pages:master

some other ways to deploy on Heroku might not work due to my use of submodules (?)

Run local server (server.coffee):

npm install  # onceenv PORT=8001 npm start  # Prints URL you can click

(you can choose any port of course.Ctrl+C when done.)

This appmostly works as pure static pages, and I intend to keep it this way.

  • From a checkout,just openindex.html in your browser.

  • Github Pages serves the gh-pages branch athttps://cben.github.io/mathdown.

  • For other branches/commits, there is no trivial solution - rawgit.com would be great but doesn't currently support submodules.

  • The easiest way to run (and share) uncommitted modifications is probably Cloud 9. TODO: test, details.

The only benefits the dynamic server is going to bring (not implemented yet) will be:

  1. Including the document text in the HTTP response for search engines (#7).
  2. Prettiermathdown.net/foobar instead ofmathdown.net/?doc=foobar URLs (#59).

Other things called "mathdown":

I should really talk to these folk whether it's OK that I'm using the name and the domain...

About

Collaborative markdown with math

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp