mirror of
https://github.com/skuro/plantuml-mode.git
synced 2024-06-20 06:46:45 +02:00
#20 Added usage documentation
This commit is contained in:
parent
463aa0d54b
commit
b31063125b
46
README.md
46
README.md
|
@ -1,7 +1,6 @@
|
|||
[![MELPA](http://melpa.org/packages/puml-mode-badge.svg)](http://melpa.org/#/puml-mode) [![MELPA Stable](http://stable.melpa.org/packages/puml-mode-badge.svg)](http://stable.melpa.org/#/puml-mode)
|
||||
|
||||
PlantUML mode for Emacs
|
||||
=======================
|
||||
# PlantUML mode for Emacs
|
||||
|
||||
<img src="https://raw.githubusercontent.com/skuro/puml-mode/master/banner.png"
|
||||
alt="puml-mode in action" title="Behold the beauty of text-based UML diagrams!" />
|
||||
|
@ -14,8 +13,7 @@ PlantUML mode for Emacs
|
|||
|
||||
A [PlantUML](http://plantuml.sourceforge.net/) major mode for Emacs.
|
||||
|
||||
Installation
|
||||
============
|
||||
# Installation
|
||||
|
||||
Make sure you have [MELPA](http://melpa.org/) enabled in your ``emacs.d``. Then, you can just
|
||||
|
||||
|
@ -27,15 +25,13 @@ Also, to enable preview you need to tell `puml-mode` where to locate the PlantUM
|
|||
M-x customize-variable<RET>
|
||||
puml-plantuml-jar-path<RET>
|
||||
|
||||
Features
|
||||
========
|
||||
# Features
|
||||
|
||||
- Syntax highlight
|
||||
- Autocompletion
|
||||
- Preview
|
||||
|
||||
Enable the major mode
|
||||
=====================
|
||||
# Enable the major mode
|
||||
|
||||
You can automatically enable `puml-mode` for files with extension `.puml` or `plantuml` by adding the following to your `.emacsrc`:
|
||||
|
||||
|
@ -45,8 +41,7 @@ You can automatically enable `puml-mode` for files with extension `.puml` or `pl
|
|||
|
||||
Of course, you can always enable manually the major mode by typing `M-x puml-mode` once in the desired PlantUML file buffer.
|
||||
|
||||
Usage
|
||||
=====
|
||||
# Usage
|
||||
|
||||
You can either tell `puml-mode` to autocomplete the word before the cursor by typing `M-x puml-complete-symbol`. This will open a popup with all the available completions as found in the list of keywords given by running PlantUML with the `-language` flag.
|
||||
|
||||
|
@ -56,8 +51,7 @@ To render the PlantUML diagram within Emacs, you can also hit `M-x puml-preview`
|
|||
- PNG
|
||||
- Unicode ASCII art
|
||||
|
||||
Default key bindings
|
||||
====================
|
||||
## Default key bindings
|
||||
|
||||
The following shortcuts are enabled by default:
|
||||
|
||||
|
@ -67,8 +61,26 @@ The following shortcuts are enabled by default:
|
|||
|
||||
C-u C-u C-c C-c puml-preview in other frame
|
||||
|
||||
Troubleshooting
|
||||
===============
|
||||
## Integration with `org-mode`
|
||||
|
||||
You can use `puml-mode` to edit PlantUML source snippets within an [`org-mode`](http://orgmode.org/) document. To do so, you need to first register it with the `plantuml` language:
|
||||
|
||||
```
|
||||
(add-to-list
|
||||
'org-src-lang-modes '("plantuml" . puml))
|
||||
```
|
||||
|
||||
Then you can edit a `plantuml` code block with `puml-mode` by hitting `C-'` while inside of the code block itself:
|
||||
|
||||
```elisp
|
||||
#+BEGIN_SRC plantuml
|
||||
<hit C-' here to open a puml-mode buffer>
|
||||
#+END_SRC
|
||||
```
|
||||
|
||||
When in the `puml-mode` buffer you can then hit again `C-'` to return to the original `org-mode` document.
|
||||
|
||||
# Troubleshooting
|
||||
|
||||
As of `v0.6.2` the following commands have been added to help resolving problems:
|
||||
|
||||
|
@ -79,15 +91,13 @@ puml-disable-debug
|
|||
|
||||
With debug enabled, the actual command used to invoke PlantUML is printed into a buffer called `*PUML Messages*`. You can inspect that buffer to make sure that PlantUML is properly set up, or use it to supply extra information when opening [issues](https://github.com/skuro/puml-mode/issues).
|
||||
|
||||
Credits
|
||||
=======
|
||||
# Credits
|
||||
|
||||
This project stemmed from the great work of [Zhang Weize](http://zhangweize.wordpress.com/2010/09/20/update-plantuml-mode/),
|
||||
and the current code still borrows a lot from it.
|
||||
|
||||
Thanks to [Pavel G. Koukoushkin](https://github.com/svargellin) for implementing the preview functionality.
|
||||
|
||||
License
|
||||
=======
|
||||
# License
|
||||
|
||||
Released under the terms of [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html). See [LICENSE.txt](https://github.com/skuro/plantuml-mode/blob/master/LICENSE.txt).
|
||||
|
|
Loading…
Reference in New Issue
Block a user