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