I have seen a lot of docs websites that have the same layout or same features.
so I am wondering if there is a library used by all these docs.
how do they do this?
./docs -> files.md -> ./docs/files.html
like you see there are a lot of files with .md (sometimes also .mdx)
and they have the same functionalities (see below)
so I am wondering if they use the same js library to generate it?
I tried to search in all the repo, what they are using to generate, but nothing says the name of a library?
is there an npm package or CDN link to that js library?
that can get the .md files inside .docs, and based on the folder structure, create a list on the left with all topics, 2 buttons with next and previous, a button with edit this page on GitHub, etc...
if isn't possible I will do it by scratch, but writing HTML for every doc is time-consuming.
I prefer some markdown fast, build consistent docs, and automatically added to the first-page list on the left.
also the routing thing for getting previous and next elements I need to do it manually and this can be time-consuming.
is there something that does that for me, some web API that gets files .md if I need to do it from scratch?
but still prefering npm package if there is.
Example:
previous and next docs.
react native
deno
lusift
and they have a button with the text EDIT THIS ON GITHUB
Mozilla docs MDN
when scrolling, it will change the color of the currently viewed section
sketch API
but I never find the name of the library.
other functionalities are...
multi-page
and much more...
(I tried to search on Github, but never find it)
it's there a good docs generator for a programming library that I create?
I also google it: https://www.google.com/search?q=javascript+library+documentation
but nothing. the libraries there are for API GET/POST swagger etc...
but I am wanting a library for functions like if you write this function this happen, maybe also code snippet functionality to see what result give you that function.
something similar to StackOverflow. text to HTML (but not need any server-side things comlicated... just keep it simple the files are inside .docs in GitHub, so just simple stuff.
maybe I am writing wrong the google keyterm
I found the solution to this, by using the #evolutionxbox comment.
how to find?
if you want to find what library is used in a GitHub repo,
go to the package.json, there you can find the list of libraries that is used on the project
the name?
in this case, the library used is DOCUSAURUS
link: https://docusaurus.io/
is very simple to config and solves the job!
and is used by
Facebook,
and other big companies like:
supabase
redux
etc...
Related
pardon if it is a silly question, I am trying to make a Javascript code editor React app and I have come across the need to add external javascript libraries as dependencies to the editor(not for the app to run, but for the editor inside it). I found the cdnjs API https://api.cdnjs.com/ which would have been perfect except for the fact that certain libraries like ml5js are not to be found in here. However if there was some way I could search unpkg like this, I could add particular libraries according to the user's choice. So, is there some api like that which could return a json object containing the list of libraries with their unpkg cdns, matching the queries sent for the library names?
Or, is there any other way I could get search from a list of javascript libraries other than unpkg?
There is no official way to search for UNPKG packages but there is a third part website https://www.unpkgsearch.com/
You can search for packages and directly copy the unpkg link
Good day all. I'm new to Grafana and we adopted it very recently at work.
I'm willing to create a plugin, I need to load a simple external js library and fire it in a Grafana panel, nothing extreme.
First problem: I don't want to use any building library (grunt or whatever), I just want to write the plugin javascript, I don't want to redistribute it. Where do I write the code?
Am I right to write the code I want to execute in the data/plugins/myplugin/dist/ folder? (I'm trying to follow the steps at Grafana Docs, but they are unclear as they talk about building and install scripts which I don't like to use).
Second Problem: Seems like that if I use the dist/ folder, the plugin get executed. Now, I'd like to import a external.js library into it, the external library will take care of display the data as I like.
into my myplugin_ctrl.js I write this:
System.register(['app/plugins/sdk', 'lodash', './css/clock-panel.css!','./libs/datamaps'], function (_export, _context) {
var PanelCtrl, _, _createClass, panelDefaults, ClockCtrl;
As you may notice, I've used the clock plugin that is used into the how-to at Grafana.
I'd like to import './libs/datamaps', what I managed to do is having this error upon adding the panel to a dashboard:
Plugin component error Error: Fetch error: 404 Not Found
Instantiating http://127.0.0.1:3000/data/plugins/test-panel/libs/datamaps
Loading http://127.0.0.1:3000/public/plugins/test-panel/clock_ctrl.js
What I'm doing wrong? Where do the datamap.js should be? Or how do I can import it into Grafana plugin?
I don't know if you really need to solve this with a plugin, as I couldn't find any mention about data retrieval from any data sources in your question. Also, I'm not yet very familiar with Grafana plugin development, but I was able to solve one JavaScript related problem without a need to write a plugin.
What I did: I put a Text element in html mode on a dashboard and inserted a <script>...</script> section as well as some HTML code. This worked until I updated Grafana to a newer version, where they started to block this due to security reasons. After configuring /etc/grafana/grafana.ini setting disable_sanitize_html = true in section [panels], I made it work again. You could do this, too, but keep in mind that this is a security risk, because the dashboards now allow to inject any kind of malicious JavaScript code.
See also this Grafana reference page for scripted dashboards.
I’ve just got started with Swagger and NodeJS. I was able to implement Swagger to my NodeExpress application and was also able to generate typescript-client-code with Swagger-Codegen (Typescript-Angular) to be exact.
One problem that I have is the generated code is so spread out many different files. I was hoping that it only output one file api.ts and it contains everything from API calls and interfaces/models.
I’ve been looking for a way to solve this problem because it is hard to read and maintain the generated-client-code as the backend grows.
Any suggestions or pointers would be much appreciated.
Happy Holiday! Thank you
EDIT: I have been looking for answers for this for a couple of days and still haven't found one. I'm currently working on a project with ASP.NET Core and they have NSwag which does what I want to achieve with Node Swagger.
TL; DR
You may compile all files into a single *.ts file as shown at this post.
Continuous Integration Approach
Swagger code generator simplifies maintenance because it allows you to think in terms of continuous integrations.
You should not be worried about code review or aesthetics (because it is a machine generated code), but about:
API versioning
Functions, methods and classes signatures
Documentation
If you are working with a CI system such as Jenkins or Ansible, you could automatically deploy the library to a private NPM account (for JS and TS) or Maven server (for Java and Kotlin).
Keeping the package version number consistently updated will allow the IDE to correctly prompt the user about updates on the API.
Swagger uses Mustache templates for generating the code. For making simpler
changes you can simple create a copy of one of the built-in templates and
modify that.
Then you can use your modified template like this:
swagger-codegen-cli generate -t path/to/template/dir/ -i spec.json
The output directory structure, however, cannot be changed using templates
alone. For that you'd need a custom codegen module. You can either create your
own or modify one of the built-in ones.
I'm considering using GitHub Pages to implement a blog and I am kind of in the mood to reinvent the wheel. I've built my website from scratch and I don't want to use Jekyll because it doesn't seem like it can be integrated into an existing website with your own theme (correct me if I'm wrong). I want the following functionalities:
Blog with articles but without the need to constantly update the html myself
Ability to write in plain text on my computer and have my website parse the data and integrate into the website's html when I push to the git repository
A feature on the website which shows a preview of the last three blog posts
The ability to search for specific blog posts hosted on my page through google
I am considering both a static and dynamic solution. The static solution would be to write a python script that reads my blog in text format and updates the blog page to include this new article by adding more html to the blog html page. The dynamic solution would have my blog page fetch articles from the github repository and integrate them into my blog live. This would also allow for fetching more articles on demand (as the user scrolls down my page for example). Is this ridiculously over complicated or does this make sense to do as a little project? Any opinions would be appreciated!
I wrote a static site generator as a Grunt plugin a few years back, so I can probably offer some good advice here.
A static site generator will convert source files (typically Markdown or a similar format for the posts and pages and templates in your templating language of choice) into flat HTML which can then be pushed up to the server. It may also include scripts for pushing it to the place where the site is hosted. If you want to do this in Python there's plenty of appropriate modules - Jinja would be a good example of an appropriate templating system, there's several Markdown implementations, and if you need syntax highlighting Pygments is a solid choice.
It's actually possible to search on the client side. My site uses Lunr.js for this - during the build process it generates an index file for the search, and then that is loaded using jQuery with the rest of the page.
Infinite scroll should also be possible without server-side scripting as it just fetches the same content using Javascript anyway. Paul Irish's Infinite Scroll plugin is no longer maintained, but it would in theory be capable of this and there are probably alternatives.
You might want to check out the article I wrote about it for ideas. The static solution works well for me - it's cheap to host and easy to deploy. You can use Disqus or Facebook comments if need be too.
A simple static site generator is a practical weekend project, and it should be a good way of achieving what you want.
How to organize Vue-JS project [files and directory]: Non Javascript way?
Coming from a non-javascript background, I found Vue.js very intuitive and easy to use. My earlier experience in Javascript is with JQuery and vanilla javascript on the browser.
I created an application using Vue , Vue-components and vue router. Everything works fine.
My problem is, I have ended up writing a lot of code in a single index.html file of my project. This file contains over 10 templates that I have created and attached to different component in my app. I want to know that is there a non-javascript way to organize these templates in seperate files.
I see that there are options using webpack and browserify to modularize the project. But coming from non javascript background, I don't find them intuitive. I don't want to go node - npm way because that has its own learning curve and moreover it downloads a dozen of files and dependencies in my project which I don't understand. I am old school and more comfortable downloading the files and including them in the webpages.
So probably, you understand where I am going to. I need a solution where I could put my templates as separate files and read those files in the different components.
What I have tried :
Declaring the templates inside my components. But writing all that html inside the component is not that clean. It also, makes my JS file too huge. I am better in putting all data in the index.html instead.
Storing template as smaller chunk "homepage.html","about.html" and in my components, using $.get / $.load to read different components in ready function of the component. This works but I still have to fire an additional ajax call for each component which is not efficient.
Please refrain from suggesting the obvious node-npm [webpack and browserify] way. I know thats what is supported by Vue but this needs a learning curve and complete setup. Answer to this question would actually help other developers who hesitate going the node-npm way.
Please shout back if you need more clarifications to the question.
The options you've mentioned are your only real ones... the HTML of the template needs to be available when it's needed, so you either have to have it within your html file off the bat, or load it using AJAX or an in-browser loader like RequireJS (and this extension that allows it to load HTML https://github.com/requirejs/text).
In-file templates make sense for very small projects. As your project grows, you'll need to start using the tools that are built for this. NPM rocks and every JS package that you'll ever need can be included in your project in seconds.
I highly encourage you to try the Vue CLI
It does use node, npm, webpack and downloads dozens of files. Which you've you've explicitly asked for not to use, so let me clarify:
The Vue CLI takes care of the complexity and configures webpack for you.
You don't even have to know it's using webpack.
It's very developer friendly (it even has a built-in gui) and lowers the barrier to entry compared configuring a webpack config.
I hope you'll also find it "intuitive and easy to use".