Git Product home page Git Product logo

octoedit's Introduction

OctoEdit

A Chrome Extension that adds a new tab to the comment edit area in GitHub, providing Markdown syntax highlighting and tabbing behavior.

Huge thanks to CodeMirror and Marijn Haverbeke for providing a free, MIT-licensed editor.

demo

Install

Features

  • Markdown syntax highlighting
  • Syntax Highlighting for most popular languages within GFM fences
  • Support for GitHub hotkey(shift + meta + p) to cycle through comment tabs

Developing

  1. Clone the repository
  2. Run npm run watch to enable rebuilds on change
  3. Load the dist folder as an unpacked extension in Chrome

Thank you to these contributors

octoedit's People

Contributors

jamestalmage avatar

Stargazers

Niko avatar hiyori avatar 王恒兴 avatar Jingyu avatar Jim Smart avatar Thomas Orten avatar CA Manas Madrecha avatar Phantas Weng avatar Jamie Sparks avatar Glenn 'devalias' Grant avatar  avatar Oliver Kopp avatar 技术无止境 avatar  avatar  avatar  avatar Chris avatar Cory Gross avatar Dipankar Pal avatar Andrei Luca avatar 余腾靖 avatar Tabulo avatar  avatar  avatar Mike Funk avatar with-heart avatar James Stephens avatar Shao Jun avatar qunincey avatar Jeremy Wu avatar Danny Nemer avatar  avatar Brian Faust avatar  avatar Ivan D Vasin avatar Steve Teo avatar Ryan Hart avatar Ephellon avatar Scott Ivey avatar Wellington Torrejais da Silva avatar Zack Campbell avatar Jonathan Clark avatar guanguans avatar Zach Kanzler avatar Claude Janssen avatar Timlukas Bloch avatar Stephy avatar shimon avatar DwanL avatar Henningstone avatar Suthep Sangvirotjanaphat avatar Alex Zinchenko avatar Shiaupiau avatar Yukai Huang avatar Dylan Frankland avatar Max Wu avatar YuanPei Li avatar Moomoo avatar Eugenio Marletti avatar Benjamin Charity avatar Anthony Maki avatar Ádám Török avatar Bill Stavroulakis avatar Cody avatar WhoChingWho avatar eg avatar Sova avatar Ben Bieler avatar RichT avatar Joel Kuzmarski avatar Nex Zhu avatar Amar Prakash Pandey avatar Sahil Dua avatar Chris Watson avatar Paul Molluzzo avatar Sarbbottam Bandyopadhyay avatar Michael Sprague avatar Daryl Chan avatar Dawson Botsford avatar Johnie Hjelm avatar Daniel Schmidt avatar Tetsuya Yoshida avatar  avatar Kyungwook, Park avatar Milos Bejda avatar Matthew Elphick avatar Barrett Harber avatar Jeroen Visser avatar Julian Grosshauser avatar Onur Temizkan avatar Yassine A. avatar  avatar Jonathan Garbee avatar Spencer Dixon avatar Lubien avatar Felipe Orlando avatar ivan k avatar sarthak avatar Rudy Affandi avatar Joshua Rosato avatar

Watchers

James Cloos avatar Tuna Aras avatar Andrew Levine avatar Ádám Török avatar  avatar

octoedit's Issues

Code sections with language not fully monospace

Love this extension! I noticed though that specifying the language results in extra classes that aren't currently captured by rules that apply font-family: monospace.

For example:

screen shot 2018-03-08 at 10 07 13 am

And after applying a language:

screen shot 2018-03-08 at 10 07 16 am

Note that the parentheses and spaces (which are trickier because they don't have an associated span) are no longer monospace.

Applying monospace to.CodeMirror-wrap pre catches the whole text box so that I didn't immediately see a solution.

Glad to submit a PR if there's an easy solution; just didn't happen to see one. Thanks again for the plugin!

Theme codemirror to match preview

Not entirely sure how simple it is, but it would be great if we just used the same fonts / highlight colors as GitHub itself.

Codemirror does have theming capabilities. Not sure what's involved.

Safari version

I am using Safari as my primary browser and I would be happy to have this extension. Or you can pack this as “user script” or “user style” to use with Stylish and/or Tampermonkey.

Options

I think we should create an options tab. Normally I subscribe to the "sensible defaults" school of thought, but editor config is just too personal. A biggie (I think) is keymap support. People will want to be able to use the same keymaps as their favorite editor.

Really, I think we could have very robust options, especially as it relates to all the addon features. In that case, supporting the "options" is already implemented, we are just creating a UI to configure them:

We could define most of codemirrors options pretty simply:

{ 
  name: 'closeTags',
  displayName: 'close tags'
  description: 'automatically close tags'

  // type boolean creates a checkbox
  type: 'boolean',
  default: 'true',

  // the scripts that need to be loaded
  scripts: [
    'codemirror/addons/editor/close-tags.js'
  ],

  // values that need to passed to Codemirror when selected
  injectedOptions: {
    autoCloseTags: true
  }
}

Support GitHub's Hotkey for cycling through comment field tabs

ctrl+meta+p is currently used by GitHub to cycle through the Write and Preview tabs. Should add support for the Code tab to be included.

GitHub handles this currently by setting data-hotkey="ctrl+P,meta+P on the next tab that should be cycled to.

Not working for latest GitHub

I cannot switch to the “Code” tab; clicking on it triggers nothing. On browser console I saw

Uncaught TypeError: Cannot read property 'classList' of null
    at dom.js:4
    at Array.forEach (<anonymous>)
    at removeClasses (dom.js:4)
    at TabHandler._onBtnClick (tab-handler.js:103)
    at HTMLBodyElement.<anonymous> (tab-handler.js:81)

Selectively load language modes.

We can probably improve performance by splitting the large bundle up, and loading language modes on demand.

We could perhaps keep track of the users most recent modes in storage, and always load them.

Codemirror already has an addon module to support this: https://codemirror.net/doc/manual.html#addon_loadmode

We would ship all the modes with the extension, but not waste time loading jade and tiki for everyone.

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.