Added docs tools
This commit is contained in:
parent
2b5408eace
commit
6ffabd2318
85
README.md
85
README.md
@ -1,51 +1,42 @@
|
|||||||
# Ronin
|
# Ronin
|
||||||
|
|
||||||
Ronin is a simple open-source graphic design tool.
|
Ronin is a simple open-source graphic design tool.
|
||||||
|
<img src='https://raw.githubusercontent.com/hundredrabbits/Ronin/master/PREVIEW.jpg' width='600'/>
|
||||||
<img src='https://raw.githubusercontent.com/hundredrabbits/Ronin/master/PREVIEW.jpg' width="600"/>
|
## Modules
|
||||||
|
## brush
|
||||||
## Example file
|
### Settings
|
||||||
|
- size
|
||||||
```
|
- color
|
||||||
surface.resize 300x300
|
- opacity
|
||||||
layer.fill #AAAAAA
|
### Methods
|
||||||
magnet.grid 15x15 4,4
|
### Ports
|
||||||
path:line_width 2
|
- speed
|
||||||
path.stroke M60,60 A1,1 0 0,0 240,60 A1,1 0 0,0 240,240
|
- distance
|
||||||
path.stroke M240,240 A1,1 0 0,0 60,240 A1,1 0 0,0 60,60
|
- red
|
||||||
```
|
- green
|
||||||
|
- blue
|
||||||
## Load a preset
|
- alpha
|
||||||
|
- x
|
||||||
Where `http://localhost:8022` will load the /presets/default.rin file, `http://localhost:8022/blank` will load /presets/blank.rin.
|
- noise
|
||||||
|
## eraser
|
||||||
## TODOs
|
### Settings
|
||||||
General
|
### Methods
|
||||||
Merge layers
|
### Ports
|
||||||
Export multiple layers file
|
## frame
|
||||||
Syntax highlight
|
### Settings
|
||||||
% Render
|
- width
|
||||||
balance auto=true ~ auto color
|
- height
|
||||||
balance 0.8 ~ equal RGB balance
|
### Methods
|
||||||
Brush
|
- resize
|
||||||
Texture paint
|
- rescale
|
||||||
Save
|
- crop
|
||||||
source.save 1280x800 ~ Export with size
|
### Ports
|
||||||
> Terminal
|
## line
|
||||||
Auto Complete(tab)
|
### Settings
|
||||||
? Interrog
|
- steps
|
||||||
Inline Help
|
### Methods
|
||||||
* Eye
|
- tween
|
||||||
Swatches, handle all colors
|
- stroke
|
||||||
- Widget
|
### Ports
|
||||||
Clickeable links
|
- index
|
||||||
- Render
|
|
||||||
Progress update
|
|
||||||
|
|
||||||
# Verreciel
|
|
||||||
|
|
||||||
Feel free to send pull requests if you find an issue that you wish to correct.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
See the [LICENSE](LICENSE.md) file for license rights and limitations (CC).
|
See the [LICENSE](LICENSE.md) file for license rights and limitations (CC).
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<script type="text/javascript" src="scripts/layers/guide.js"></script>
|
<script type="text/javascript" src="scripts/layers/guide.js"></script>
|
||||||
<script type="text/javascript" src="scripts/layers/render.js"></script>
|
<script type="text/javascript" src="scripts/layers/render.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="scripts/docs.js"></script>
|
||||||
<script type="text/javascript" src="scripts/io.js"></script>
|
<script type="text/javascript" src="scripts/io.js"></script>
|
||||||
<script type="text/javascript" src="scripts/query.js"></script>
|
<script type="text/javascript" src="scripts/query.js"></script>
|
||||||
<script type="text/javascript" src="scripts/keyboard.js"></script>
|
<script type="text/javascript" src="scripts/keyboard.js"></script>
|
||||||
@ -26,6 +27,11 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
const {dialog,app} = require('electron').remote;
|
||||||
|
const fs = require('fs');
|
||||||
|
const app_path = app.getAppPath();
|
||||||
|
|
||||||
var ronin = new Ronin();
|
var ronin = new Ronin();
|
||||||
ronin.install();
|
ronin.install();
|
||||||
</script>
|
</script>
|
||||||
|
86
sources/scripts/docs.js
Normal file
86
sources/scripts/docs.js
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
function Docs()
|
||||||
|
{
|
||||||
|
this.export = function()
|
||||||
|
{
|
||||||
|
var html = "";
|
||||||
|
|
||||||
|
html += this.print_intro();
|
||||||
|
html += "## Modules\n";
|
||||||
|
html += this.print_modules(ronin.modules);
|
||||||
|
|
||||||
|
html += this.print_license();
|
||||||
|
|
||||||
|
var str = html;
|
||||||
|
|
||||||
|
dialog.showSaveDialog((fileName) => {
|
||||||
|
if (fileName === undefined){ return; }
|
||||||
|
fs.writeFile("README.md", str, (err) => {
|
||||||
|
if(err){ alert("An error ocurred creating the file "+ err.message); return; }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_intro = function()
|
||||||
|
{
|
||||||
|
html = "# Ronin\n";
|
||||||
|
html += "Ronin is a simple open-source graphic design tool.\n";
|
||||||
|
html += "<img src='https://raw.githubusercontent.com/hundredrabbits/Ronin/master/PREVIEW.jpg' width='600'/>\n";
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_modules = function(modules)
|
||||||
|
{
|
||||||
|
var html = "";
|
||||||
|
|
||||||
|
for(module_name in modules){
|
||||||
|
var module = modules[module_name];
|
||||||
|
html += "## "+module_name+"\n";
|
||||||
|
html += this.print_settings(module.settings);
|
||||||
|
html += this.print_methods(module.methods);
|
||||||
|
html += this.print_ports(module.ports);
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_settings = function(settings)
|
||||||
|
{
|
||||||
|
var html = "### Settings\n";
|
||||||
|
|
||||||
|
for(setting_name in settings){
|
||||||
|
var setting = settings[setting_name];
|
||||||
|
html += "- "+setting_name+"\n";
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_methods = function(methods)
|
||||||
|
{
|
||||||
|
var html = "### Methods\n";
|
||||||
|
|
||||||
|
for(method_name in methods){
|
||||||
|
var method = methods[method_name];
|
||||||
|
html += "- "+method_name+"\n";
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_ports = function(ports)
|
||||||
|
{
|
||||||
|
var html = "### Ports\n";
|
||||||
|
|
||||||
|
for(port_name in ports){
|
||||||
|
var port = ports[setting_name];
|
||||||
|
html += "- "+port_name+"\n";
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.print_license = function()
|
||||||
|
{
|
||||||
|
html = "## License\n";
|
||||||
|
html += "See the [LICENSE](LICENSE.md) file for license rights and limitations (CC).\n";
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
}
|
@ -33,6 +33,11 @@ function Keyboard()
|
|||||||
ronin.render.clear();
|
ronin.render.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e.key == "H" && (e.ctrlKey || e.metaKey) && e.shiftKey){
|
||||||
|
e.preventDefault();
|
||||||
|
ronin.docs.export();
|
||||||
|
}
|
||||||
|
|
||||||
ronin.hint.update(e);
|
ronin.hint.update(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -8,6 +8,7 @@ function Ronin()
|
|||||||
this.commander = new Commander();
|
this.commander = new Commander();
|
||||||
this.cursor = new Cursor();
|
this.cursor = new Cursor();
|
||||||
this.hint = new Hint();
|
this.hint = new Hint();
|
||||||
|
this.docs = new Docs();
|
||||||
|
|
||||||
this.grid = new Grid();
|
this.grid = new Grid();
|
||||||
this.guide = new Guide();
|
this.guide = new Guide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user