@@ -11,6 +11,7 @@ You can see an online demo [here](https://nturley.github.io/netlistsvg)
11
11
12
12
# Installation/Usage Instructions
13
13
14
+ ## Command Line Interface
14
15
Install nodejs if isn't already installed
15
16
```
16
17
npm install -g netlistsvg
@@ -24,6 +25,40 @@ The default value for the output file is out.svg.
24
25
25
26
Should work on Linux, OSX, and Windows. Running the build scripts (makefiles and the web demo) is easiest on Linux and OSX.
26
27
28
+ ## Web bundle
29
+
30
+ I have a web bundle hosted on github pages here: https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js
31
+ It doesn't wrap ELKjs, so you'll need to include it separately. ELK creates a global variable, so you'll need to include ELKjs before netlistsvg.
32
+
33
+ In HTML it would look something like this
34
+ ``` html
35
+ <script type =" text/javascript" src =" https://nturley.github.io/netlistsvg/elk.bundled.js" ></script >
36
+ <script type =" text/javascript" src =" https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js" ></script >
37
+ ```
38
+
39
+ On ObservableHQ, you can require it like this.
40
+
41
+ ``` javascript
42
+ netlistsvg = {
43
+ var ELK = await require (' https://nturley.github.io/netlistsvg/elk.bundled.js' )
44
+ window .ELK = ELK
45
+ return require (' https://nturley.github.io/netlistsvg/built/netlistsvg.bundle.js' )
46
+ }
47
+ ```
48
+
49
+ You may want to download and host your own copy.
50
+
51
+ The web bundle includes both the analog and digital skin and an example netlist for each. Using a promise would look like this.
52
+ ``` javascript
53
+ await netlistsvg .render (netlistsvg .digitalSkin , netlistsvg .exampleDigital );
54
+ ```
55
+ Or to log the result to console using the callback API:
56
+ ``` javascript
57
+ netlistsvg .render (netlistsvg .digitalSkin , netlistsvg .exampleDigital , (err , result ) => console .log (result));
58
+ ```
59
+
60
+ To turn Verilog into YosysJSON in the browser, you can use [ YosysJS] ( http://www.clifford.at/yosys/yosysjs.html )
61
+
27
62
# Examples
28
63
29
64
Here's an digital netlist produced by Yosys along with the diagram that netlistsvg created from it.
0 commit comments