Giter Club home page Giter Club logo

vscode-markdown-note's Introduction

is also the ultimate note & memo App built on VSCode

image

VSCode + Markdown + WYSIWYG = Productivity


πŸ”· Seamless

Click on what you want to edit to enter input mode.

Once you finish editing, press the ESC key.

Press the ESC key again to return to input mode.


πŸ”· Cell Editing

Cell is familiar to Jupyter Notebook users.

Every Cell has its own isolated editing history , so undo&redo works uniquely.


πŸ”· Headers

You can see the exact header size based on the current CSS before converting to HTML by entering # .


πŸ”· Paste URL & ImageURL from Clipboard

You can use a shortcut key (Ctrl+L for URLs, Ctrl+P for images by default Key Bindings) to paste URLs or imageURLs from the clipboard as Markdown on selected text .

Here is how it goes:

  1. Your clipboard has an imageURL: https://raw.githubusercontent.com/ken-okabe/vscode-markdown-note-images/main/octcat.png

  2. Type any image name in the Cell (octcat)

  3. Select all, then paste the imageURL (Ctrl+A,P)

  4. Exit the Cell (Esc)

Alternatively, you can skip typing the image name and just

  1. Paste the imageURL (Ctrl+P)
  2. Exit the Cell (Esc)

and it will work just fine 😎

For imageURLs, image is used as the default name.

For URLs, the pasted URL itself is used as the default link text. So when you just paste https://github.com/ with Ctrl+L, the result will be https://github.com/.


πŸ”· Drag&Drop Cells


πŸ”· GFM & features supported by GitHub


πŸ”· Paste Code & Mathematics(LaTeX) from Clipboard

In Markdown Note, you can add Code & Mathematics(LaTeX) in the same way as Paste URL & ImageURL from Clipboard.

  • We usually copy&paste URLs & ImageURLs from the clipboard.
  • We usually copy&paste Code & Mathematics(LaTeX) from the clipboard.

$Mathematics(LaTeX)$

  1. Your clipboard has: \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.

  2. Paste the Math (Ctrl+M)

  3. Exit the Cell (Esc)


$Code (including Mermaid)$

  1. Your clipboard has:
graph LR
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
  1. Paste the Code (Ctrl+K)
  2. Exit the Cell (Esc)


$Inline$

To insert inlineCode & inlineMath, you can use the same operation as for (inline) Bold or (inline) Italic, that is, select the target strings , then press the ShortcutKey: Ctrl+?.


πŸ”· ReadOnly & Writable Mode

By default, Markdown Note works in Writable Mode , but some web elements need user's click action even in Markdown documents.

For example, Markdown used in GitHub ( not GitHub Flavored Markdown Spec ) supports <details> and <summary> html tags.

To test the native behavior, you can switch to ReadOnly Mode temporarily with Ctrl+Esc.

In ReadOnly Mode , the default behavior of Markdown Note is paused and you can click the element in the standard manner.

This way, you can see how <details> and <summary> html tags work.

Pressing Ctrl+Esc again will return to the default Writable Mode.


πŸ”· Unidirectional Data Flow

Bidirectional data flow might look cool, but it often causes confusion for both humans and software architectures.

The conventional Markdown Preview has a unidirectional data flow :

  • Markdown source code -> The read-only preview.

Markdown Note also uses the same simple unidirectional design, but in the opposite direction :

  • WYSIWYG Editor -> Markdown source code.

πŸ”· Reload to Side or Overlay

The user needs to reload the contents explicitly after editing the Markdown source code in the standard VSCode editor, since the data flow is unidirectional .

The user can choose which panel to reload:

  • to Side
  • Overlay

The reload action helps to reconstruct the entire markdown Cells with integrity after a full modification of the document by native editing.


πŸ”· Key Bindings (Extension Keyboard Shortcuts)

You can use Key Bindings for everything except drag and drop; you can also customize them.


πŸ”· Paste Images with one Keystroke

The general key binding Ctrl+V for pasting works for both text and images .

With one Keystroke, this feature allows you to upload the clipboard image to your own image-only repository on GitHub and automatically insert its URL in the Cell to display it.

You need to create a dedicated image repository and an access token on GitHub to use this feature. This feature does not work with secret repositories, and your images will be public.

You can also use a secret Gist to store your images, but there is no API for that yet.

You can still display images by using your own URL as before, if you prefer not to use a public repository or a secret Gist.


πŸ”· Works with VSCode’s full potential

You can use VSCode features, such as undo/redo/select the whole document , or managing files with directories and Git , for any operations that are not suitable for the Cell editing.


πŸ”· Getting Started

Take advantage of VSCode Empty Profile

To get started quickly and simply, you can take advantage of an empty and isolated VSCode profile to install Markdown Note, or use any VSCode profile you like later.


0. Create a new VSCode Empty Profile, then install Markdown Note

Click βš™οΈ at the left bottom to Create Profile

image

Select Empty Profile

image

Let's name the new profile writing

image

Now you have the new Empty Profile

image

Finally, please remember to install Markdown Note in the new Empty Profile !!😎


1. Copy&Paste the JSON copied at the built-in walkthrough page into the empty settings.json of Empty Profile

After installing Markdown Note, the built-in Setup Walkthrough page will automatically launch.

Use Ctrl+A to select all, then Ctrl+C to copy the generated JSON on the page.

image

Paste (Ctrl+A,P) into the empty settings.json of Empty Profile

image

Save ( Ctrl+S ) and Done!

The built-in Setup Walkthrough page guides you step by step and does not require VSCode reload, so for now just prepare Empty Profile.


Command for VSCode Profiles

You can use the --profile command-line interface option to launch VS Code with a specific profile.

code --profile writing my-documents

A new Empty Profile with the given name is created if the profile specified does not exist.


πŸ”· Settings & Customizations

settings.json Simplified

Here is a simplified settings.json .

image


System

"files.autoSave": "afterDelay",
"files.autoSaveDelay": 500,

If autoSave with a short interval is not enabled, the VSCode standard editor will report an error on saving that is similar to the Git non-fast-forward error. This issue has not been thoroughly investigated, but 500 ms seems to be a reliable and stable setting.


"workbench.editor.autoLockGroups": {
   "mainThreadWebview-MarkdownNote": true
},

This is autoLockGroups feature, which is neccesary for Side-by-side mode. LockGroup allows you to lock an editor group in VSCode to prevent unintended multi-tab experiences. Without this feature, a user would need to manually lock the group on every occasion.

image


Themes

"workbench.colorTheme": "Visual Studio Light",

In most cases, the theme in VSCode is configured through a GUI.

image

Some dark themes can make the scroll bar almost invisible in Markdown Note.


"markdownnote.CSS": {
    "URLs": [
    "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",
    "https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css",
    "https://unpkg.com/[email protected]/themes/prism-coldark-dark.min.css"
    ]
},

There are CSSs to replicate the GitHub Markdown style:

https://cdnjs.com/libraries/github-markdown-css

https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-light.css https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-dark.css

image

You can generate by yourself.

$ github-markdown-css --list
light
dark
dark_dimmed
dark_high_contrast
dark_colorblind
light_colorblind
light_high_contrast
light_tritanopia
dark_tritanopia

https://github.com/settings/appearance

image

Code highlighting can be styled independently with Prism


Utility Options

"markdownnote.start_overlay": {
    "true OR false": true
},

You can select a layout ( Overlay or Side-by-side ) to start with; Overlay is the default.


"markdownnote.image_repository": {
    "repository": "USER/IMAGES-REPOSITORY",
    "token": "ghp_xxxxxxxxxxxxxxxxxxxx"
}

The general key binding Ctrl+V for pasting works for both text and images .

With one Keystroke, this feature allows you to upload the clipboard image to your own image-only repository on GitHub and automatically insert its URL in the Cell to display it.

You need to create a dedicated image repository and an access token on GitHub to use this feature. This feature does not work with secret repositories, and your images will be public.

For more information on managing personal access tokens on GitHub, you can refer to the official documentation.


πŸ”· The ultimate note & memo App built on VSCode

image

VSCode is such a great editor.

The only problem with VSCode is that it’s not suitable for casual use as a daily note and memo app .

The reason is that Markdown editing is not WYSIWYG .

Markdown Note transforms VSCode into your daily note and memo app, and it's probably the most powerful one in the world.

Your notes and memos are now natively managed with secret repos in GitHub !

image

With combinations of VSCode profile and command, you can easily create a shortcut key to launch the app.

This is Linux & Gnome, and the way to create shortcut keys and icons differs depending on the OS.

In this case,

  • Profile is note
  • Directory is /home/ken/Documents/note
  • Shorcut key is Ctrl+F1
code --profile note /home/ken/Documents/note

πŸ”· Invest in the software that powers your world!

image

https://github.com/sponsors

image

Markdown Note is also planning to join GitHub Sponsors in the near future.

If you like this project, you can join the future of open source by investing todayπŸ˜‰

vscode-markdown-note's People

Contributors

ken-okabe avatar

Stargazers

桅川 avatar  avatar  avatar Tao Xin avatar  avatar Motz / Ryuta Sakamoto avatar Etherealxx avatar  avatar

Watchers

 avatar

Forkers

etherealxx

vscode-markdown-note's Issues

Entire Codeblock should be grey or not grey, not just the code line.

This:
image

formats to this:
image

The background (grey) on just the code itself makes it look messy when large blocks of code are displayed:
image

It would be nicer if the entire block's background was grey (I prefer this) or if the block's background was white. Jupyter does this.

image

Maybe this could be a setting in VSCode ? I'd like it if the entire codeblock had a grey background so it sets off from plain text.

MarkdownNoteView edits are not entering in the .md file ?

I just created a couple pages of content using the MarkdownNoteView window. When I look at the source file (.md) for the View window, it is not updating.

I did not do any editing in the .md file.

I did save the .md file once. I think I clicked in the window and used Ctrl-S. But I might have used File->Save.

Is this a bug ?

Is there a way to force the View window to write to the .md file ?

Idea: is it possible to hide the .md file while editing in the View window ? It would be less confusing and more intuitive not to see the source .md file. You could then toggle back and forth between seeing the View and seeing the raw .md file ?

Edit: just had it happen again. It has something to do with saving the .md file.

BTW: I LOVE having cells in a MD document.

Code after a title isn't regular text.

Ken: I'm going to be using Markdown Note pretty heavily over the next while. I'll probably find some issues. Don't take this as bad or criticism, I'm just trying to be constructive.

I don't know much about markdown editors but at some point I might jump in and work on Markdown Note myself.

Issue: the markdown code after a title heading isn't regular text. It is the font and size of the title text.

Example:
image

Here is what it looks like in Jupyter:
image

Markdown Note does format it correctly.
image

Additional comment: it would be nice if various markdown elements in Markdown Note were color coded like they are in Jupyter. Maybe VSCode can be set up to do this ? Or should it be done in Markdown Note ?

Excellent Work ! Thanks !

I've been looking for a WYSIWYG markdown editor for a lone time. Your VSCode extension is fantastic !

Great work. Thanks.

Update

Not to sound ungrateful, but is there a way to install (some of) the Markdown Note key shortcuts onto the right click menu ? T'would be very handy.

I love the way your editor uses cells. I've been using Jupyter Notebooks, which I hate. I'll convert all my Notebook docs to straight markup now.

Is there a way to "hot link" sections of code from another file into a markup doc ? Say I want to include a code block from a C file into my document and I want it to be hotlinked so that if I change the code, the code in the document changes with it ? That would be so handy for documentation. Kinda like how Jupyter can have Python code in it. But I don't need the code to run in the Markdown doc, I just want to want to reference it so I can document something.

Edit: It looks like this can be done with "Contributes Command".

Any suggestions for (easily) porting Jupyter Notebooks to Markdown files ?

Help

Please help me

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.