How to generate Semantic UI offline doc - node.js

It's been a long time I dident generate the docs (since 0.19.3 ), and it seems that the doc was separated.
I dont know how to generate the docs, because it is not well explained:
Before running server you will need to build your UI files for the docs. Semantic UI includes a special command to build files for a docs instance that must be run from an adjacent Semantic UI folder. for example with a directory vendor -> SemanticUI place docs folder inside vendor to reflect vendor -> SemanticUI | docs
Can you please guide me how to do it?
From the Semantic UI source, i run npm install , it installed all what needed, and then when I run gulp build-docs it generated a docs folder which is outside the source, this one, if i run inside it the command docpad run, I dont get the right HTML, because I dont know where to put the Separated Docs downloaded.

Answered here
Just pick what you're missing to get it complete.
(It probably has some typos.)
A terminal is required.
Assumed folder structure:
path/to/your/bull polished/project
|
`_ docs
|
`_ learn
|
`_ ui
N.B.
All 3 subfolders docs, learn, ui may be given different names.
Subfolders docs and ui must be adjacent folders.
At the moment learnsemantic.com (learn) is independent of the other 2 repos. So it could be placed anywhere you like.
Clone the repos:
cd path/to/your/bull polished/project
docs:
git clone --recursive --progress -v "git#github.com:Semantic-Org/Semantic-UI-Docs.git" "docs"
Cloned https://github.com/Semantic-Org/Semantic-UI-Docs (http://semantic-ui.com/)
learn:
git clone --recursive --progress -v "git#github.com:Semantic-Org/Learn-Semantic.git" "learn"
Cloned https://github.com/Semantic-Org/Learn-Semantic (http://learnsemantic.com/)
ui:
git clone --recursive --progress -v "git#github.com:Semantic-Org/Semantic-UI.git" "ui"
Cloned https://github.com/Semantic-Org/Semantic-UI (The Semantic UI framework)
N.B.
When you don't want to clone all the SUI repo history, read this : #220 (comment)
Install Gulp globally AND locally.
npm install -g gulp
cd "path/to/your/bull polished/project/ui"
npm install gulp
Install the Semantic UI framework.
(Still in : "path/to/your/bull polished/project/ui")
npm install
gulp
OR:
gulp install
Install Docpad globally AND locally. Install Docpad plugins locally.
Install globally:
npm install -g docpad
Note: To update globally docpad upgrade
Then install locally into docs:
cd "path/to/your/bull polished/project/docs"
npm install docpad
docpad install eco
Then install locally into learn:
cd "path/to/your/bull polished/project/learn"
npm install docpad
docpad install eco
Note: To update locally (docpad and plugins) run: docpad update inside the docs and learn folders.
NB
docpad update purges/obliterates the docs/out folder (which was filled with dist and src folders, and files by gulp build-docs, gulp-serve-docs, and docpad run)
So when the time comes, run docpad update before building the Docs from the ui folder.
Run npm install docpad as root/Administrator (to avoid permission issues).
Definitely on Windows.
Sometimes also on Linux/OS X, if Node was installed "incorrectly".
But at least on Linux/OS X you can reinstall Node to correct this.
See: node-forward/help#4
Build the Semantic UI framework:
cd "path/to/your/bull polished/project/ui"
Only if required:
gulp clean
Followed by:
gulp build OR gulp watch
Build the Semantic UI framework for the Documentation in the docs folder:
cd "path/to/your/bull polished/project/ui"
gulp build-docs OR gulp serve-docs
gulp build-docs : Creates and fills docs/out/dist and docs/out/src
gulp serve-docs : Watches for source file changes in the ui folder and updates folders docs/out/dist and docs/out/src.
Generate the Semantic UI Documentation pages and start the local server:
cd "path/to/your/bull polished/project/docs"
docpad run
docpad run : Creates all documentation files and folders (other than docs/out/dist and docs/out/src) in the docs/out folder.
Generate the learnsemantic.com pages and start the local server:
cd "path/to/your/bull polished/project/learn"
docpad run
docpad run : Creates all documentation files and folders in the learn/out folder.
When you're changing the SUI framework variables, etc
1) Make your changes to the framework.
2) Rebuild the framework:
gulp clean (only when necessary)
gulp build OR gulp watch
3) Update the docs:
gulp build-docs OR gulp serve-docs
4) Generate the documentation pages.
docpad run OR docpad server
Go back to 1)
If you used gulp watch and gulp serve-docs you should be fully automatic.

Related

Running npm build before/after npm install

I'm not familiar with npm so I might be holding the wrong end of the shovel here...
There is a package on npm that I would like to modify and use in my own project. The package is angular-crumbs. I forked the source repo (https://github.com/emilol/angular-crumbs) into my own account (https://github.com/capesean/angular-crumbs) and then run npm install capesean/angular-crumbs -force. However, this produces a node_modules folder in my project that hasn't been built (and whatever else - as I understand it) with the commands in the source repo's package.json file:
"build": "npm run clean && npm run transpile && npm run package && npm run minify && npm run copy"
i.e. it doesn't have the types, the correct package.json file, etc.
So my question is, how do I get the properly-built files (including type definitions, etc.) from my own repo to install or build-after-installing in my target project?
I am not sure about what you're trying to do, are trying to work on the
angular-crumbs source code, or are you trying to use it in your own project as a dependencuy ?
Anyway, running npm install will install all your dependencies so that you can directly use them in your project, those dependencies don't need to be built after they are installed.
In your case you seem to have an angular application (which is completely different from node.js), usually to start an angular app you can run ng serve which will build your source code and run an angular server so you can access it on localhost.

NodeJS - npm install practice

Created new folder and did npm install serve in it.
It created package-lock.json and node_modules/ folder.
When I run in the same folder serve it shows error:
command not found: serve
What is the way to install?
I am using: npm#6.5.0
My dev environment is MACOS
I read a great many pages on this topic and nothing worked until I tried the following
./node_modules/.bin/serve -s build
Also if you are using VS CODE you may want to bring up the terminal window outside of VS CODE - this seems to have snared a lot of people.
First of all, you should start your project running
npm init
This will create the package.json file.
Then, you can install the serve package globally.
npm install -g serve
And now you can run serve.
The serve binary was not found because the operating system cannot locate it in the PATH environment variable.
When you do the npm install serve command. The serve module is only installed into the node_modules directory found under the the project folder. Unless you explicitly include the absolute path of this node_module directory as part of your PATH env var, the OS won't know where to find serve.
Like others say, the typical practise would be to install the module using the -g flag. G means global.
When -g is used, npm will put the binary in its node directory somewhere and this this directory would have been included as part of your PATH when you install node, thus making the any new binary discoverable.
If the node.js module has a "command" and you want to run it without installing the module globally(npm install -g serve). You can run it like ./node-modules/.bin/command from the root folder of the project.
Now, what is generally used is npx, so that you can from within a project easily run any of the binaries within its local node_modules or your system's global node_modules/ and any other commands on the $PATH.
For example, here we install webpack as a local dependency. You can image doing this in a folder after running npm init. Then we run webpack without having to worry about referencing the bin file:
$ npm i -D webpack
$ npx webpack

NodeJS Build Package (zip) using Grunt on Jenkins

I'm trying to build a package (zip) using grunt in Jenkins (though Jenkins is kind of irrelevant at this stage).
Basically the code is checked out of git, and I run
npm install --production
but grunt needs the files installed locally.
So I run
npm install
But now I have all the grunt packages in the node_modules directory.
As part of the grunt build I simply want to copy the node_modules directory into the package.
Am I headed down the right track with trying to package my code using grunt?
Or should I be using grunt to only run jslint, unit tests etc and use this to package: https://github.com/zeit/pkg
The output is another tool that I will be calling from the command line.

Run npm install or bower update on multiple repositories in folder

I have 3-5 repos in my parent /git folder that I have to individually run npm install, bower update, and grunt/grunt build. I was wondering if there is a way to where I can do it on the parent folder and it will run it for specific repos that I can specify. Similar for git commands there is a git multi, where I can do git multi pull/status/etc. for the repos I have listed in a .gitmulti file.
For example I can run a command like npm multi install, then it will run npm install on repos I have specified in a file. Similarly I would like to be able to do something like bower multi update and will run bower update on repos I specified.
I've thought of doing similar tasks with Grunt, here's how I would first try to approach your problem:
grunt-exec is a grunt plugin that lets you script out your shell commands in grunt. To install grunt-exec, run npm install grunt-exec --save-dev in the parent directory for your projects.
Next, add the corresponding grunt config object to your gruntfile. We'll keep things simple and do it statically:
exec: {
foo: {
cwd: 'foo/`, //one of your projects
cmd: 'npm install && bower install'
}
}
Create additional targets within the grunt exec config object for each of your project directory. Once that's complete, run grunt exec from the parent directory.

Ember CLI ember new and ember init files not showing but buildable

I'm using ember v1.13.15, node: 5.4.1, npm 2.14.10 and os linux x64 (ubuntu). I'm actually trying to get ember-cli into my rails app. When executing ember new frontend I get the output that a bunch of files were created. These files don't show up in nautilus, terminal via ls nor can I cd into the directory. I manually typed mkdir frontend && cd frontend then ember init with the same results. If I run ember init again it recognizes the files are there because it asks me if I want to overwrite some files.
Running ember build produces a successful build, but where are the files?
Updated with terminal
uhoh#eblinux:~/Documents/apps/mvp$ cd frontendconsumer/
uhoh#eblinux:~/Documents/apps/mvp/frontendconsumer$ ls
uhoh#eblinux:~/Documents/apps/mvp/frontendconsumer$ ember init
version: 1.13.15
Could not find watchman, falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
installing app
identical .bowerrc
identical .editorconfig
identical .ember-cli
identical .jshintrc
identical .travis.yml
identical .watchmanconfig
identical README.md
identical app/app.js
identical app/index.html
identical app/router.js
identical app/templates/application.hbs
identical bower.json
identical config/environment.js
identical ember-cli-build.js
identical .gitignore
identical package.json
identical public/crossdomain.xml
identical public/robots.txt
identical testem.json
identical tests/.jshintrc
identical tests/helpers/destroy-app.js
identical tests/helpers/module-for-acceptance.js
identical tests/helpers/resolver.js
identical tests/helpers/start-app.js
identical tests/index.html
identical tests/test-helper.js
Installed packages for tooling via npm.
Installed browser packages via Bower.
uhoh#eblinux:~/Documents/apps/mvp/frontendconsumer$ ls
uhoh#eblinux:~/Documents/apps/mvp/frontendconsumer$ ls -a
. ..
Update v2
uhoh#eblinux:~/Documents/apps/mvp/frontendconsumer$ locate test-helper.js --all
/home/uhoh/Documents/apps/integration/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js
/home/uhoh/Documents/apps/newapp/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js
/home/uhoh/Documents/apps/vd-integrations/test/test-helper.js
/home/uhoh/Downloads/ace1.3.1/mustache/js/node_modules/htmlparser2/tests/test-helper.js
/home/uhoh/Downloads/ace1_3.0/mustache/js/node_modules/htmlparser2/tests/test-helper.js
/home/uhoh/Downloads/ace3/mustache/js/node_modules/htmlparser2/tests/test-helper.js
/home/uhoh/consumer_frontend/node_modules/ember-cli/blueprints/app/files/tests/test-helper.js
/home/uhoh/consumer_frontend/node_modules/ember-cli-babel/tests/test-helper.js
/home/uhoh/consumer_frontend/node_modules/ember-cli-content-security-policy/tests/test-helper.js
/home/uhoh/consumer_frontend/node_modules/ember-cli-qunit/node_modules/broccoli-jshint/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js
I am unable to comment, so instead I will offer you two main options:
Uninstall all ember related packages and push node to 5.6.0 and npm to 3.6.0 (the version that I using.)
npm uninstall -g ember-cli
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Install Ember and the needed packages, confirm version of node and npm and try to create the project.
Probe the files on the frontendconsumer folder:
Typesyncand see if something shows up on Nautilus.
Use locate test-helper.js -c or locate any other file that was supposed to be there. If the result is 0 then give the other locate params a try.
Type baobab and see if something shows up on the folder.
If nothing yet, then try find -type l to see if there are any symbolic links.
Run a checkdisk on your hard drive.
If none of those options helped, then something really weird is going when scaffolding the new application... If there is no other issues on your system, try to create a rails app through RVM to see if the scaffold of a new app works out. If it does, then chances are that something within npm, node or the ember packages are bad. Otherwise, it may be your system.

Resources