Giter VIP home page Giter VIP logo

smartmarkdown's Introduction

SmartMarkdown for Sublime Text 2 & 3

Author: Muchenxuan Tong ([email protected])

Introduction

The plugin is aimed at making editing Markdown in Sublime Text 2 easier and more powerful. Ideally, I hope we can bring several amazing features of Org-mode of Emacs into Sublime Text.

What's new

v0.3: Adjust the position of folding mark to the end of headline. (added by vovkkk and alehandrof)

v0.2: Support for Sublime Text 3 (added by UNOwen.)

v0.1.6: Add support and bindings for headline level changing. (added by David Smith.) The key bindings are: Super+Shift+, for decreasing and Super+Shift+. for increasing.

v0.1.5: Basic smart table (grid table) support added. Basic Pandoc intergration (added by DanielMe.)

v0.1.3: Add support for global headling folding / unfolding.

v0.1.2: Move between headlines supported!

  • Use Ctrl+c Ctrl+n to move to the next headline (any level); Ctrl+c Ctrl+p to the previous one.
  • Use Ctrl+c Ctrl+f to move to the next headline (same level or higher level); Ctrl+c Ctrl+b to the previous one.
  • Fixed a bug on bullet list. Thanks to quodlibet (fixed in v0.1.1).

v0.1.0: Created!

  • Smart Headline folding / unfolding is supported.
  • Smart Lists is supported.

Done

  • Smart Headline folding / unfolding. Right now you can fold / unfold headlines by pressing TAB on it. I assume you use the following formats: # Section; ## Subsection; ### Subsubsection ...
  • Global Headline Folding / unfolding. Shift+Tab to Fold / Unfold all at any position.
  • Smart Order / Unordered list. When editing lists, you can just press ENTER and this plugin will automatically continue the list. Once the content of the list becomes empty it will stop.
  • Move between headlines.
    • Use Ctrl+c Ctrl+n to move to the next headline (any level); Ctrl+c Ctrl+p to the previous one, for Mac. (Ctrl+; Ctrl+n and Ctrl+; Ctrl+p for Windows and Linux)
    • Use Ctrl+c Ctrl+f to move to the next headline (same level or higher level); Ctrl+c Ctrl+b to the previous one, for Mac. (Ctrl+; Ctrlf and Ctrl+; Ctrl+b for Windows and Linux)
  • Adjust headline level Added by David Smith.
    • Super+Shift+, for decreasing and Super+Shift+. for increasing headline levels.
  • Smart table
    • Currently, the smart table suppose only the Grid table format of Pandoc. Use monospaced fonts, otherwise it would appear bizarre.
    • The behavior is like the table in Org-mode. If you are unfamiliar with Org-mode, just use | (vertical line) to separate the column (e.g. | header1 | header 2 |), and use the TAB to reformat the table at point. Everything would fall into the place. Add +- and then press TAB for adding separator between rows. Add += and then press TAB for adding separator between header and the table body. Read the Grid tables section of Pandoc Userg's Guide for more information.
    • Use TAB to move forward a cell in table, Shift+TAB to move backward.
    • Personally I plan to use grid table as a basis and add command for converting to other table formats if necessary.
  • Basic Pandoc integration with Pandoc By integrating SublimePandoc. Added by DanielMe.
    • Note: If you need to generate PDF output, please make sure you have pdflatex available (MacTeX for Mac, or TeX Live for other OS). Please also specify "tex_path" in the package settings (Preference - Package Settings - SmartMarkdown - Settings - User (see Settings - Default as an example.))

Todo

  • Embeded R & Python Code for reproducible research
  • Better Pandoc integration Actual support for different Pandoc command line options etc.
  • ...

For Developers

  • Whenever possible, please obey the PEP 8 style guide. This can be checked easily with the plugin SublimeLinter.
  • git-flow is recommended (but not enforced) as a development work flow. For instruction please read Why aren't you using git-flow?. To adapt it, a command line tool gitflow is highly recommended.
  • Please work on the develop branch, it's newer than master. the master branch is for users.

License

The plugin is licensed under the MIT license.

Copyright (C) <2012> Muchenxuan Tong [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

smartmarkdown's People

Contributors

alehandrof avatar danielme avatar demon386 avatar djs070 avatar iristyle avatar mhenry07 avatar unowen avatar vovkkk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smartmarkdown's Issues

Control Folding Behavior

This plugin is great -- the folding feature is just what I needed. Is it possible to control the "global folding" behavior so that shift + tab folds/unfolds all <h2>'s rather than <h1>'s? I'm not seeing this in the API and would prefer not to hack your source code.

how to render html/pdf with pandoc?

i can't find any command in the command palette associated with pandoc execution. How do we turn markdown to html from sublime-text using smart-markdown?

Pandoc generation fails to files with russian symbols

Pandoc don't generate any files if text contains russian (cyrillic) simbols.

for example simple md-code on which nothing happens:

# Фига

For myself I run pandoc with parameter -V lang:russian to supprt russian symbols.

How to install?

Can you provide a quick pointer for installing your add-on into Sublime Text 2? I'm new to ST2, and I have no idea how to install add-ons. It looks like, on my Mac, you drop .packages into ~\Application Support\Sublime Text 2\Packages, but the files I see there all have the .package extension, not the individual files in your git repository. Thanks.

Does not find pandoc on Windows

Smartworkdown simply does not work on Windows because it cannot find pandoc.exe. With sublime text 3, the plugin is stored as a package and there is no easy way to modify the path to Pandoc.exe

Unexpected behaviour in Smart Tables

Pandoc allows markdown, including code blocks, inside of grid tables. This is very frequently useful. However, the current implementation zaps all white space at the beginning of cells, ruining code indentation/formatting.

I've submitted a pull request with a fix.

Smart list generating extra bullet

Here is a sample smart list:

-li
- li
- - li
- - 

As you can see an extra bullet is generated sometimes. It seems like the extra space after the bullet is causing this. If I remove the space it generates one bullet like in the first line.

[Feature request] Disable smart_list option

1. Request

It would be nice, if would be possible to disable run smart_list command.

2. Actual behavior

Sasha is:

1. Star!
2. Galaxy!
3. Universe!

3. Expected behavior

Sasha is:

1. Star!
1. Galaxy!
1. Universe!

4. Justification

I preferred to use numbered list without increment, because:

  1. If I want to create new item between already exist, I don't need to change numbers below.
  2. It MD029 markdownlint rule.

5. Desirable behavior

If in settings file "mde.auto_increment_ordered_list_number": false,, user will have expected behavior, not actual.

User may comment or remove lines 12—23, but if package will update, user needs to make changes again.

6. Examples on other apps

See similar setting in Markdown Editing package.

Thanks.

Add option to disable the error highlighting

I have a problem where I'm using the "~" symbol within some text to indicate approximation and SmartMarkdown is highlighting it as an error (because it's looking for the closing ~ which would indicate strikethrough, I suppose).

Can I turn off this error reporting? Preferably just for tildes

Emphasis wrapping of highlighted text

This is a feature request based on a feature in MarkdownEditing (which I can't use reliably for a few reasons.)
* and _ should behave like parenthesis and quotes do in other code, when you select some text and type *, it should wrap that text with the *. When there is a second paired * in your text, typing another should simply skip it (like typing a closing quote when one has been provided.)

Basically, match the behavior of Sublime's quotes.

"Outline View"

This is a feature request.

I want to be able to view all the headers in a document as an "outline view" of large documents, in order to navigate quickly and see the birds-eye view.

So, I'd love the SHIFT-TAB behavior to show all the headers instead of just the top-level ones.

Shortcut for changing heading level

Hi

How about adding support to increase / decrease heading level? Maybe Cmd + Square Brackets?

I'm happy to implement the code for this if someone agrees that it's a good feature.

D

I don't get it O_O

I guess I don't understand how to use this plugin.
I installed the plugin and tried to use it on *.txt, *.md and *.org files, but I didn't get the command pallete commands nor did the tab worked.

Can you please explain how to use the basic functionality of the plugin?
Thanks.

Feature: Quick nested list indenting

It would be nice if I could just hit tab when I have a list item and increase the indentation level. Also, I know shift-tab folds the headings up, but maybe shift-alt-tab or something else to decrease the indent level. I use your plugin for note taking and it's great. Thanks.

Moving columns in tables

Does SmartMarkdown support moving table columns left / right? If not, I think this would be a great addition since doing it manually takes lots of edits in a big table.

Do a smart indent on long list items

On IA writer for mac and ueberwriter for linux, you have a smart indent feature, that indents softwraped lines to align them with the text, rather than the list's bullet.
It seems like inserting two spaces, but those are acutally not saved (it is a softwrap anyway).

E.g.:

  • this is the simulation of a very
    long line how it is displayed atm.
  • this is the simulation of a smart
    indenting of softwraped lines.

Is that even possible in sublime? If yes, it would come nice in the next update ;-)

Highlighting of embedded latex?

Is it possible to identify embedded latex and use latex syntax highlighting for those chunks — as is the case for the html/js syntaxes?

Cannot indent code that contains a pipe "|"

When I try to indent a whole code block that contains a "|", the indentation doesn't happen. Nothing happens.
Example code:

    // Shortcode for custom language selector
    // Use: [custom_lang_selector]
    function dfx_wpml_custom_language_selector(){
        do_action(' dfx_lang_switcher("fr,nl,en"," | ") ');
    }
    add_shortcode( 'custom_lang_selector', 'dfx_wpml_custom_language_selector' );

Worse, when I try to indent only the line that contains the "|" (line 4 in this case), most of the code is removed. To me it looks like a bug. Maybe an incompatibility with the tables functionality.

Deactivating SmartMarkdown restores the possibilitly of indenting normally.

No such file or directory: 'pandoc'

I'm getting the popup error:

No such file or directory: 'pandoc'

The reason for this is that pandoc is not on whatever path sublimetext is using.

You have a place to add tex_path and the jclement version pandoc_render.py is based on has a user option pandoc_path. I'd recommend adding a user option for pandoc as well.

Pasting over lists

When moving list items around I often find myself pasting a bulleted line on a line with a bullet created by Smart List. So, if I have - Something on the clipboard I end up with:

- - Something

How possible/efficient/practical/etc. would it be, when pasting in markup.list, to examine the clipboard and, if the content begins with the same bullet as the current line, to paste over it? (This would probably work by removing the - that the Smart List has created, rather than fiddling with the content in the clipboard.)

6 seconds to global-fold with 3000 headings

So this is in the category of first-world problems, but given I can load this 3000-headlined Markdown file into Python, do a bunch of regexp on it, and write it to JSON in much less than one second, I hope Sublime can be induced to fold the headlines in less than six seconds. All of Sublime freezes during these six seconds.

Smart Fold Lists

Is it possible to extend the Smart Fold functionality to include lists?

I've been outlining a lot in Markdown recently and it would be very useful to have a keybinding to fold and collapse lists. (But not tab, because I use that for indenting/unindenting as per #9 :)

Slight adjustment to make smart_folding work — perhaps document?

Just installed. Excited this still works!
smart_folding wasn't working for me but global_folding was so I changed a line in the key bindings and it worked!
Note: just changed the operand in smart to match that in global: text.html.markdown

Not sure what it did but it made me happy.
old:

{ "keys": ["tab"], "command": "smart_folding", "context":
    [
        { "key": "selector", "operator": "equal", "operand": "markup.heading.markdown" }
    ]
},
{ "keys": ["shift+tab"], "command": "global_folding", "context":
    [
        { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
    ]
},

new:

{ "keys": ["tab"], "command": "smart_folding", "context":
    [
        { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
    ]
},
{ "keys": ["shift+tab"], "command": "global_folding", "context":
    [
        { "key": "selector", "operator": "equal", "operand": "text.html.markdown" }
    ]
},

Why it doesn't work?

I am using sublime text 3 (3114) on a mac with el capitan. I downloaded smart markdown, but, in editing a markdown file, nothing as claimed in the read me file happens.
First of all, section folding does not work: TAB just gives me some spacing, not folding.
Second, table does not function either. But automatic list-generation does work, which starts to confuse me. What might I have done wrong?
Thanks in advance for any help.

Blank line before lower-numbered (higher-level) heading

Is there a way to not fold the blank line before a heading into the previous fold?

Example:
mediocre_docket_txt

I have a blank line before "Timeline", but it gets folded into the level 3 block above it. When I look at this I get confused and think maybe it didn't unfold correctly, or I made a mistake and that "Timeline" should also be a level 3 heading.

I would only expect the blank line to show if the heading is higher in the hierarchy than the previous fold.

Support for Markdown in Fountain files

I'm trying to get headline folding working in Fountain files. I added the following keybinding to my User Keymap file and the console says it activates the smart_folding command but it doesn't fold the text and it just inserts a tab character. So there must be some code in smart_folding.py that prevents it from running on Fountain files. It would be cool to just get this working on my own.

{ "keys": ["tab"], "command": "smart_folding", "context":
        [
            { "key": "selector", "operator": "equal", "operand": "markup.section.fountain" }
        ]
    }

Rendering to DocX, fails to find images.

I have been trying using to the SmartMarkdown Plugin to render to PDF and HTML without issue and including the images but when I try to render it to DocX I get the following error:

Fail to generate output.
�Command: pandoc -t docx    /var/folders/j_/lpm97wj53cbc0cnprvps5nh00000gn/T/tmprCTLsX.md -o /Users/jomahoney/code/FYP/Project.docx

Errors: pandoc: Could not find image `images/login.png', skipping...
pandoc: Could not find image `images/profile.png', skipping...
pandoc: Could not find image `images/module.png', skipping...
pandoc: Could not find image `images/workbench.png', skipping...

But as mentioned the images are in the correct directory. I notice the the render uses a temp file, perhaps this is causing the images to not be found? Any ideas?

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.