asciinurse 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.idea/.name +1 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/asciinurse.iml +35 -0
- data/.idea/compiler.xml +22 -0
- data/.idea/copyright/profiles_settings.xml +3 -0
- data/.idea/misc.xml +14 -0
- data/.idea/modules.xml +8 -0
- data/.idea/uiDesigner.xml +124 -0
- data/.idea/vcs.xml +6 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.adoc +127 -0
- data/Rakefile +2 -0
- data/asciinurse.gemspec +26 -0
- data/config/asciinurse.yml +22 -0
- data/examples/charts/browsers-googlecharts.json +21 -0
- data/examples/charts/browsers-highcharts.json +64 -0
- data/examples/charts/browsers.csv +7 -0
- data/examples/charts/googlecharts.adoc +83 -0
- data/examples/charts/googlecharts.html +652 -0
- data/examples/charts/googlecharts.pdf +0 -0
- data/examples/charts/highcharts.adoc +83 -0
- data/examples/charts/highcharts.html +1126 -0
- data/examples/charts/highcharts.pdf +0 -0
- data/examples/charts/indicators.csv +13 -0
- data/examples/convert.rb +10 -0
- data/i18n/en_US.yml +12 -0
- data/i18n/pt_BR.yml +12 -0
- data/lib/asciinurse.rb +76 -0
- data/lib/asciinurse/extensions/charts/chart_data.rb +57 -0
- data/lib/asciinurse/extensions/charts/extension.rb +124 -0
- data/lib/asciinurse/version.rb +3 -0
- data/resources/googlecharts/converter/googlecharts-convert.js +25 -0
- data/resources/googlecharts/converter/template.html +24 -0
- data/resources/googlecharts/javascripts/global.js +8 -0
- data/resources/googlecharts/templates/chart.html.erb +6 -0
- data/resources/googlecharts/templates/charts/bar.json.erb +22 -0
- data/resources/googlecharts/templates/charts/column.json.erb +22 -0
- data/resources/googlecharts/templates/charts/donut.json.erb +14 -0
- data/resources/googlecharts/templates/charts/line.json.erb +13 -0
- data/resources/googlecharts/templates/charts/pie.json.erb +13 -0
- data/resources/highcharts/converter/broken-axis.js +6 -0
- data/resources/highcharts/converter/data.js +26 -0
- data/resources/highcharts/converter/drilldown.js +17 -0
- data/resources/highcharts/converter/funnel.js +13 -0
- data/resources/highcharts/converter/heatmap.js +23 -0
- data/resources/highcharts/converter/highcharts-3d.js +46 -0
- data/resources/highcharts/converter/highcharts-convert.js +620 -0
- data/resources/highcharts/converter/highcharts-more.js +54 -0
- data/resources/highcharts/converter/highcharts.js +325 -0
- data/resources/highcharts/converter/highmaps.js +353 -0
- data/resources/highcharts/converter/jquery.1.9.1.min.js +5 -0
- data/resources/highcharts/converter/map.js +56 -0
- data/resources/highcharts/converter/no-data-to-display.js +12 -0
- data/resources/highcharts/converter/solid-gauge.js +14 -0
- data/resources/highcharts/converter/treemap.js +30 -0
- data/resources/highcharts/javascripts/global.js +6 -0
- data/resources/highcharts/javascripts/highcharts.min.js +325 -0
- data/resources/highcharts/javascripts/jquery.min.js +4 -0
- data/resources/highcharts/templates/chart.html.erb +6 -0
- data/resources/highcharts/templates/charts/generic.json.erb +15 -0
- data/resources/highcharts/templates/charts/pie.json.erb +45 -0
- metadata +163 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3029a39f9e3b627bdeedf02cd13fa936ab380bf8
|
4
|
+
data.tar.gz: e340b07a2b1d4bfcbe6dd0fa30e00047b699f0e6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 508c43ad2299b7a7cb089a590593e0c107da476bf0785a54755e85b82640941bbbc741c85ff3a64d5bc048c07f86bc683c5d0d7620268d38a9705a1929f0aaae
|
7
|
+
data.tar.gz: 2539131f41fed38fea8650fade506e529b87c53426ebd29d3e49e040e7e69db56a44b05994269743d5199967a0e498c9ff5522c2ef654d9bb2c1edd7e1fa2c69
|
data/.gitignore
ADDED
data/.idea/.name
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
asciinurse
|
data/.idea/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build asciinurse-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install asciinurse-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v0.1.0 and build and push asciinurse-0.1.0.gem to Rubygems" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
4
|
+
<exclude-output />
|
5
|
+
<content url="file://$MODULE_DIR$" />
|
6
|
+
<orderEntry type="inheritedJdk" />
|
7
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
8
|
+
<orderEntry type="library" scope="PROVIDED" name="Ascii85 (v1.0.2, RVM: ruby-2.2-head) [gem]" level="application" />
|
9
|
+
<orderEntry type="library" scope="PROVIDED" name="addressable (v2.3.8, RVM: ruby-2.2-head) [gem]" level="application" />
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="afm (v0.2.2, RVM: ruby-2.2-head) [gem]" level="application" />
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="asciidoctor (v1.5.2, RVM: ruby-2.2-head) [gem]" level="application" />
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="asciidoctor-pdf (v1.5.0.alpha.7, RVM: ruby-2.2-head) [gem]" level="application" />
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.8.4, RVM: ruby-2.2-head) [gem]" level="application" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="css_parser (v1.3.6, RVM: ruby-2.2-head) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="hashery (v2.1.1, RVM: ruby-2.2-head) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="pdf-core (v0.2.5, RVM: ruby-2.2-head) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="pdf-reader (v1.3.3, RVM: ruby-2.2-head) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="polyglot (v0.3.5, RVM: ruby-2.2-head) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="prawn (v1.2.1, RVM: ruby-2.2-head) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="prawn-icon (v0.6.4, RVM: ruby-2.2-head) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="prawn-svg (v0.18.0, RVM: ruby-2.2-head) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="prawn-table (v0.1.1, RVM: ruby-2.2-head) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="prawn-templates (v0.0.3, RVM: ruby-2.2-head) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v10.4.2, RVM: ruby-2.2-head) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-rc4 (v0.1.5, RVM: ruby-2.2-head) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="safe_yaml (v1.0.4, RVM: ruby-2.2-head) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.4, RVM: ruby-2.2-head) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="treetop (v1.5.3, RVM: ruby-2.2-head) [gem]" level="application" />
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="ttfunk (v1.2.2, RVM: ruby-2.2-head) [gem]" level="application" />
|
30
|
+
</component>
|
31
|
+
<component name="RModuleSettingsStorage">
|
32
|
+
<LOAD_PATH number="0" />
|
33
|
+
<I18N_FOLDERS number="1" string0="$MODULE_DIR$/i18n" />
|
34
|
+
</component>
|
35
|
+
</module>
|
data/.idea/compiler.xml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="CompilerConfiguration">
|
4
|
+
<resourceExtensions />
|
5
|
+
<wildcardResourcePatterns>
|
6
|
+
<entry name="!?*.java" />
|
7
|
+
<entry name="!?*.form" />
|
8
|
+
<entry name="!?*.class" />
|
9
|
+
<entry name="!?*.groovy" />
|
10
|
+
<entry name="!?*.scala" />
|
11
|
+
<entry name="!?*.flex" />
|
12
|
+
<entry name="!?*.kt" />
|
13
|
+
<entry name="!?*.clj" />
|
14
|
+
<entry name="!?*.aj" />
|
15
|
+
</wildcardResourcePatterns>
|
16
|
+
<annotationProcessing>
|
17
|
+
<profile default="true" name="Default" enabled="false">
|
18
|
+
<processorPath useClasspath="true" />
|
19
|
+
</profile>
|
20
|
+
</annotationProcessing>
|
21
|
+
</component>
|
22
|
+
</project>
|
data/.idea/misc.xml
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
4
|
+
<OptionsSetting value="true" id="Add" />
|
5
|
+
<OptionsSetting value="true" id="Remove" />
|
6
|
+
<OptionsSetting value="true" id="Checkout" />
|
7
|
+
<OptionsSetting value="true" id="Update" />
|
8
|
+
<OptionsSetting value="true" id="Status" />
|
9
|
+
<OptionsSetting value="true" id="Edit" />
|
10
|
+
<ConfirmationsSetting value="0" id="Add" />
|
11
|
+
<ConfirmationsSetting value="0" id="Remove" />
|
12
|
+
</component>
|
13
|
+
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="RVM: ruby-2.2-head" project-jdk-type="RUBY_SDK" />
|
14
|
+
</project>
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/asciinurse.iml" filepath="$PROJECT_DIR$/.idea/asciinurse.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
@@ -0,0 +1,124 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="Palette2">
|
4
|
+
<group name="Swing">
|
5
|
+
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
6
|
+
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
7
|
+
</item>
|
8
|
+
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
9
|
+
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
10
|
+
</item>
|
11
|
+
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
12
|
+
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
13
|
+
</item>
|
14
|
+
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
|
15
|
+
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
16
|
+
</item>
|
17
|
+
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
18
|
+
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
19
|
+
<initial-values>
|
20
|
+
<property name="text" value="Button" />
|
21
|
+
</initial-values>
|
22
|
+
</item>
|
23
|
+
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
24
|
+
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
25
|
+
<initial-values>
|
26
|
+
<property name="text" value="RadioButton" />
|
27
|
+
</initial-values>
|
28
|
+
</item>
|
29
|
+
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
30
|
+
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
31
|
+
<initial-values>
|
32
|
+
<property name="text" value="CheckBox" />
|
33
|
+
</initial-values>
|
34
|
+
</item>
|
35
|
+
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
36
|
+
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
37
|
+
<initial-values>
|
38
|
+
<property name="text" value="Label" />
|
39
|
+
</initial-values>
|
40
|
+
</item>
|
41
|
+
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
42
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
43
|
+
<preferred-size width="150" height="-1" />
|
44
|
+
</default-constraints>
|
45
|
+
</item>
|
46
|
+
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
47
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
48
|
+
<preferred-size width="150" height="-1" />
|
49
|
+
</default-constraints>
|
50
|
+
</item>
|
51
|
+
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
52
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
53
|
+
<preferred-size width="150" height="-1" />
|
54
|
+
</default-constraints>
|
55
|
+
</item>
|
56
|
+
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
57
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
58
|
+
<preferred-size width="150" height="50" />
|
59
|
+
</default-constraints>
|
60
|
+
</item>
|
61
|
+
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
62
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
63
|
+
<preferred-size width="150" height="50" />
|
64
|
+
</default-constraints>
|
65
|
+
</item>
|
66
|
+
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
67
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
68
|
+
<preferred-size width="150" height="50" />
|
69
|
+
</default-constraints>
|
70
|
+
</item>
|
71
|
+
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
72
|
+
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
73
|
+
</item>
|
74
|
+
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
75
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
76
|
+
<preferred-size width="150" height="50" />
|
77
|
+
</default-constraints>
|
78
|
+
</item>
|
79
|
+
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
80
|
+
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
81
|
+
<preferred-size width="150" height="50" />
|
82
|
+
</default-constraints>
|
83
|
+
</item>
|
84
|
+
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
85
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
86
|
+
<preferred-size width="150" height="50" />
|
87
|
+
</default-constraints>
|
88
|
+
</item>
|
89
|
+
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
90
|
+
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
91
|
+
<preferred-size width="200" height="200" />
|
92
|
+
</default-constraints>
|
93
|
+
</item>
|
94
|
+
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
95
|
+
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
96
|
+
<preferred-size width="200" height="200" />
|
97
|
+
</default-constraints>
|
98
|
+
</item>
|
99
|
+
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
|
100
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
101
|
+
</item>
|
102
|
+
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
103
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
104
|
+
</item>
|
105
|
+
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
106
|
+
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
107
|
+
</item>
|
108
|
+
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
109
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
110
|
+
</item>
|
111
|
+
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
112
|
+
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
113
|
+
<preferred-size width="-1" height="20" />
|
114
|
+
</default-constraints>
|
115
|
+
</item>
|
116
|
+
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
|
117
|
+
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
118
|
+
</item>
|
119
|
+
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
|
120
|
+
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
121
|
+
</item>
|
122
|
+
</group>
|
123
|
+
</component>
|
124
|
+
</project>
|
data/.idea/vcs.xml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Ataxexe
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.adoc
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
# Asciinurse
|
2
|
+
|
3
|
+
Asciinurse is a set of useful extensions to make http://asciidoctor.org[Asciidoctor] even better!
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
[source,ruby]
|
10
|
+
----
|
11
|
+
gem 'asciinurse'
|
12
|
+
----
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
----
|
17
|
+
$ bundle
|
18
|
+
----
|
19
|
+
|
20
|
+
Or install it yourself as:
|
21
|
+
|
22
|
+
----
|
23
|
+
$ gem install asciinurse
|
24
|
+
----
|
25
|
+
|
26
|
+
## Configuration
|
27
|
+
|
28
|
+
Asciinurse uses, by default, a `$HOME/.asciinurse` directory. To change this, just declare a `ASCIINURSE_USER_DIR`
|
29
|
+
variable containing the directory of your choice.
|
30
|
+
|
31
|
+
Anything can be overridden in Asciinurse just by placing the same file in your `ASCIINURSE_USER_DIR` (maintaining the
|
32
|
+
tree, of course). This means that if you don't like our provided resource (such as the chart templates), you can just
|
33
|
+
drop your version of it and Asciinurse will use that. You can also override any config key by using the
|
34
|
+
`$ASIINURSE_USER_DIR/asciinurse.yml` file.
|
35
|
+
|
36
|
+
## Charts
|
37
|
+
|
38
|
+
This extension enables the use of charts in documents. With an html5 backend, Asciinurse will generate a chart using
|
39
|
+
HTML and Javascript (using the *canvas* tag). The supported engines are:
|
40
|
+
|
41
|
+
- http://highcharts.com[Highcharts] (default)
|
42
|
+
- https://developers.google.com/chart/[Google Charts]
|
43
|
+
|
44
|
+
[IMPORTANT]
|
45
|
+
====
|
46
|
+
Highcharts is the default engine because Google Charts does not allow offline use. Make sure you have the rights to use
|
47
|
+
it or switch to Google Charts.
|
48
|
+
====
|
49
|
+
|
50
|
+
### Usage
|
51
|
+
|
52
|
+
It's pretty straightforward to use charts. Just declare the engine you want to use (or leave it to use the default):
|
53
|
+
|
54
|
+
[source,adoc]
|
55
|
+
----
|
56
|
+
:charts: highcharts
|
57
|
+
----
|
58
|
+
|
59
|
+
To insert a chart, you have three ways:
|
60
|
+
|
61
|
+
* Point to a json to configure the chart (maximum flexibility)
|
62
|
+
* Point to a csv file that contains the data
|
63
|
+
* Insert the data as a csv file inline
|
64
|
+
|
65
|
+
#### Using a JSON file
|
66
|
+
|
67
|
+
If you use Highcharts, you can put the json file as if in a web page. For Google Charts, you need to pass a JSON
|
68
|
+
containing the following attributes:
|
69
|
+
|
70
|
+
type:: The object that will draw the chart (like `google.visualization.PieChart`)
|
71
|
+
data:: The datatable that holds the data (you can wrap a multidimensional array using the function
|
72
|
+
`google.visualization.arrayToDataTable` as well)
|
73
|
+
options:: The chart options to pass (as if using in a web page)
|
74
|
+
style:: The chart dimensions (_width_ and _height_)
|
75
|
+
|
76
|
+
[source,adoc]
|
77
|
+
----
|
78
|
+
chart::mychart.json[]
|
79
|
+
----
|
80
|
+
|
81
|
+
#### Using a CSV file
|
82
|
+
|
83
|
+
You can drop a CSV file and make a reference to it:
|
84
|
+
|
85
|
+
[source,adoc]
|
86
|
+
----
|
87
|
+
chart::mychart-data.csv[type=pie]
|
88
|
+
----
|
89
|
+
|
90
|
+
[IMPORTANT]
|
91
|
+
====
|
92
|
+
Remember to use a CSV with a header and pass the chart type.
|
93
|
+
====
|
94
|
+
|
95
|
+
#### Inline a CSV
|
96
|
+
|
97
|
+
[source,adoc]
|
98
|
+
----
|
99
|
+
.Inline Chart
|
100
|
+
[chart,pie]
|
101
|
+
....
|
102
|
+
CSV DATA HERE
|
103
|
+
....
|
104
|
+
----
|
105
|
+
|
106
|
+
[IMPORTANT]
|
107
|
+
====
|
108
|
+
Remember to use a CSV with a header and pass the chart type.
|
109
|
+
====
|
110
|
+
sa
|
111
|
+
### Chart Images
|
112
|
+
|
113
|
+
To put charts on a PDF file, we need to produce a temporary image from the HTML5 chart. Asciinurse's default
|
114
|
+
implementation uses http://phantomjs.org[PhantomJS] and requires an accessible `phantomjs` executable in your `PATH`.
|
115
|
+
|
116
|
+
[IMPORTANT]
|
117
|
+
====
|
118
|
+
Remember that you will need an Internet connection for generating images from Google Chart.
|
119
|
+
====
|
120
|
+
|
121
|
+
## Contributing
|
122
|
+
|
123
|
+
1. Fork it ( https://github.com/[my-github-username]/asciinurse/fork )
|
124
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
125
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
126
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
127
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/asciinurse.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'asciinurse/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'asciinurse'
|
8
|
+
spec.version = Asciinurse::VERSION
|
9
|
+
spec.authors = ['Ataxexe']
|
10
|
+
spec.email = ['ataxexe@devnull.tools']
|
11
|
+
|
12
|
+
spec.summary = "The best Asciidoctor's assistant"
|
13
|
+
spec.homepage = 'http://devnull.tools'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'asciidoctor', '~> 1.5'
|
22
|
+
spec.add_dependency 'asciidoctor-pdf', '~> 1.5.0.alpha.7'
|
23
|
+
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.8'
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
26
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
charts:
|
2
|
+
default: highcharts
|
3
|
+
|
4
|
+
highcharts:
|
5
|
+
include:
|
6
|
+
- jquery.min.js
|
7
|
+
- highcharts.min.js
|
8
|
+
- global.js
|
9
|
+
convert:
|
10
|
+
file: highcharts-convert.js
|
11
|
+
command: phantomjs %s -infile %s -outfile %s -scale 2.5
|
12
|
+
|
13
|
+
googlecharts:
|
14
|
+
defaults:
|
15
|
+
width: 100%
|
16
|
+
height: 600px
|
17
|
+
include:
|
18
|
+
- https://www.google.com/jsapi
|
19
|
+
- global.js
|
20
|
+
convert:
|
21
|
+
file: googlecharts-convert.js
|
22
|
+
command: phantomjs --ignore-ssl-errors=true %s %s %s
|