Skip to content

Commit b759462

Browse files
committed
Update Readme #29
1 parent 7cda643 commit b759462

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ MBeautifier is a lightweight M-Script based Matlab source code formatter usable
88
Main features
99
-------------
1010

11-
- Padding operators with white spaces based on the configuration.
12-
- Fixing white space padding of keywords
11+
- Padding operators with white spaces based on the XML configuration file.
12+
- Correction white space padding of keywords
1313
- Correction of indentation using the Smart Indent functionality of the Matlab Editor
1414
- Removal of continuous empty lines (the number can be configured)
15-
- Optionally inserting missing element separators (commas) in matrix and cell array declarations
16-
- Different working modes: format the current page of the Matlab editor, format only a selection in the Matlab Editor or format files
15+
- Optionally inserting missing element separators (commas) in matrix and cell array initializations
16+
- Different working modes: format the current page of the Matlab editor, format only a selection in the Matlab Editor or format file(s)
1717

1818
Deployment and Configuration
1919
----------------------------
2020
Add containing directory to the Matlab path, then execute: `MBeautify.setup()`.
2121

2222
This command will create the standard configuration of formatting stored in `MBeautifier\resources\settings\MBeautyConfigurationRules.m`.
2323

24-
This file is used in run-time to gather the configuration rules, therefore when the configuration has been modified, executing this function again will make the rules active.
24+
This file is used in run-time to gather the configuration rules, therefore when the configuration XML file has been modified, executing this function again will make the rules active.
2525

2626
### Configuration
2727

@@ -41,7 +41,7 @@ Each `OperatorPaddingRule` represents the formatting rules for one single operat
4141
<ValueTo> ~= </ValueTo>
4242
</OperatorPaddingRule>
4343

44-
The above example shows the rules for the "not equals" operator. The `ValueFrom` node stores the operator `~=` and the `ValueTo` node stores the expected formatting: the operator should be preceded and followed by a white-space character.
44+
The above example shows the rule for the "not equals" operator. The `ValueFrom` node stores the operator `~=` and the `ValueTo` node stores the expected format: the operator should be preceded and followed by a white-space character.
4545

4646
All of the operator padding rules are collected dynamically, therefore adding a new node to this list then executing the `setup` command will result in that MBeautifier will replace the currently added node also.
4747

@@ -65,10 +65,18 @@ Currently there are three approaches supported:
6565

6666
- Perform formatting on the currently active page of Matlab Editor. Command: `MBeautify.formatCurrentEditorPage()`. By default the file is not saved, but it remains opened modified in the editor. Optionally the formatted file can be saved using the `MBeautify.formatCurrentEditorPage(true)` syntax.
6767
- Perform formatting on the currently selected text of the active page of Matlab Editor. Command: `MBeautify.formatEditorSelection()`. An optional saving mechanism as above exists also in this case. Useful in case of large files, but in any case `MBeautify.formatCurrentEditorPage()` is suggested.
68-
- Perfrom formatting on a file. Command: `MBeautify.formatFile(file)`. Can be used with (1)one argument: the input file is formatted and remains open in the Matlab editor unsaved; (2)two arguments as `MBeautify.formatFile(file, outFile)`: the formatted file is saved to the specified output file if possible. Output can be the same as input.
68+
- Perform formatting on a file. Command: `MBeautify.formatFile(file)`. Can be used with (1)one argument: the input file is formatted and remains open in the Matlab editor unsaved; (2)two arguments as `MBeautify.formatFile(file, outFile)`: the formatted file is saved to the specified output file if possible. Output can be the same as input.
69+
- Perform formatting on several files in a directory. Command: `MBeautify.formatFiles(directory, fileFilter)`. The first argument is an absolute path to a directory, the second one is a wildcard expression (used for `dir` command) to filter files in the target directory. The files will be formatted in-place (overwritten).
6970

7071
Supported Matlab versions
7172
-------------------------
7273

7374
As MBeautifier uses the built-in Matlab Editor functionality, it supports Matlab versions from R2011a.
7475

76+
Planned future versions
77+
-----------------------
78+
79+
As Matlab does not contain any formatter even in R2017 releases, this project will be maintained until at least R2018 (if that release will contain a formatter).
80+
81+
As it is planned at the moment, the current release is the last one which is M-Script based, and the next release is planned to be implemented in Java with Matlab interface. This is the first step to make MBeautifier also usable in Octave.
82+

0 commit comments

Comments
 (0)