How can I combine vuepress dev mode with apidoc output? - vuepress

I want to add some docs to my project, there are two kind of docs, guide doc and apidoc, and I use apidocjs.com as my apidoc solution.
Vuepress has dev mode and build mode, I can make vuepress and apidoc work together in build mode, but I can not make it work in dev mode.
I have tried to output /api/ to .vuepress/api or .vuepress/public/api, they are all not work for me when I run vuepress dev docs. Any suggestions here?

I found the answer by myself.
By this doc describing:
https://vuepress.vuejs.org/guide/assets.html#public-files
I just run apidoc and vuepress in this way:
mkdir -p docs/.vuepress/public/api && apidoc -i controller/ -o docs/.vuepress/public/api && vuepress dev docs

Related

How does yarn find a module installed as a dev-dependency

script object in the package.json files is the modern replacement for Gulp or a similar build tool. Assume that Vuepress is installed with yarn add -D vuepress (meaning that the vuepress is installed locally in the node_modules folder.
Further, assume that the package.json file contains the following script object:
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
How does the command yarn docs:dev executed in the terminal resolve the vuepress object? More often than not a similar invocation results with the error vuepress not recognized ...
P.S. Since I do not have vuepress in the path environment variable the only place where it can be resolved is in the root level node_modules folder.
I guessed correctly - both npm and yarn (invoked from the terminal) have the ability to inspect all environment variables, as well as search the folder node_modules. In my concrete example, running the command
npm run env | grep scripts
results with
npm_config_ignore_scripts=
npm_config_scripts_prepend_node_path=warn-only
npm_package_scripts_docs_build=vuepress build docs
npm_package_scripts_docs_dev=vuepress dev docs
npm_package_scripts_env=env
There is a lot more information in the article https://techsparx.com/nodejs/tools/npm-build-scripts.html

Run Kibana without bundling the JS files

I need to add some custom code to one of the JS files present in the Kibana release zip: https://www.elastic.co/downloads/kibana
Right now, when I run the Kibana I see the following JS files which are minified and bundled:
and it comes from the Kibana's optimize folder:
Is there any way to run the non modified version present at /src location:
My goal is to add a custom querystring param to each search request done via Kibana:
http://localhost:5601/elasticsearch/_msearch
therefore, trying to figure out the exact file which make this request but right now with minified file it seems hard to find that location.
If we have to make some change in any of the existing JS file, the optimize folder has to be deleted so that on next restart of Kibana service the file bundling can take place to acomodate our custom change. This takes enough time which makes the debugging with JS files of Kibana very time consuming.
How to prevent this bundling step so that the JS debugging can become easy with Kibana.
I believe that the best approach for what you want to achieve is to clone Kibana GitHub repository since trying to work with a minified version of the scripts that Kibana utilizes are nearly impossible, the purpose of minified JS is not to editable but lightweight.
Keep in mind that you are going to need to install all the necessary dependencies. All of it is explained on the CONTRIBUTING.md the file available in the official repository.
I could get it up and running with the following commands, but I'm a Linux user, you are going to need to use the equivalent on windows.
# Prepare your environment
# Install node 10.15.2 as specified in the file .node-version
# Install OpenJDK-8
apt-get update && \
apt-get install -y openjdk-8-jdk && \
apt-get install -y ant && \
apt-get clean;
# Setup JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
export JAVA_HOME
# Install dependencies and run
git clone https://github.com/[YOUR_USERNAME]/kibana.git kibana
cd kibana
npm i yarn -g
yarn kbn bootstrap
yarn start

Apidoc installed as global: how to run it?

I've installed APIDoc.js packages globally, using yarn.
yarn global add apidoc
I'm on a Debian 9.8.
Actually...
which apidoc
... doesn't return any path. So running ...
apidoc
... results in a
command not found
How can I execute apidoc when globally installed?
I ended running it using npx
npx apidoc ...< rest of params >

Individual builddir not working in Sphinx

i'm working on a Mac and use Sphinx 1.6.3 to build a documentation for my software.
Recently I tried the Internationalization feature, which works quite well.
But now I wanted to export the different language into different folders:
doc/de
doc/en
doc/fr
According to the docs, its simple:
$ sphinx-build -b html sourcedir builddir
http://www.sphinx-doc.org/en/master/usage/quickstart.html#running-the-build
So I tried this:
make -e SPHINXOPTS="-D language='en'" -b html /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer/doc/_build/html/en/
Which gives gives me the strange error:
Error: source directory and destination directory are same.
What am I doing wrong?
Issue solved. I had to use sphinx-build and not make
sphinx-build -b html /Applications/MAMP/htdocs/sakkadentrainer/doc/ /Applications/MAMP/htdocs/sakkadentrainer/doc_en/

Can Grunt run a .cshtml (asp.net mvc) file?

I have a project that I am working on that has:
backend done with ASP.NET MVC ( the web API)
frontend done with Angular-JS , Grunt and Node JS.
The question posed here for the team was:
Have a part of the page ( a menu, navbar for example) being controlled my ASP.MVC and the rest (content) to be generated/controlled by angular.
Would NodeJS be able to do this (frankenstein-ish) task?
The answer is YES.
A good starting example would be to take a look at yeoman generator-aspnetmvc
$ npm install -g yo //install yeoman
$ npm install -g generator-aspnetmvc //install generator-aspnetmvc from npm
$ mkdir YourProject
$ cd YourProject
$ yo aspnetmvc //initiate the generator
The project in this example should give you an idea about how your grunt file can be configured to work with MVC applications.

Resources