Giter VIP home page Giter VIP logo

nicedoc.io's People

Contributors

axelhzf avatar coliff avatar gimenete avatar hartca avatar helpermethod avatar imgbotapp avatar kant avatar kikobeats avatar nucliweb avatar tatthien avatar wooorm avatar xxczaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nicedoc.io's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Integrate with RunKit

Would be nice to automatically integrate codeblocks in the readme with RunKit so user's are one click away from trying them out.

Ascii Doctor support

Hello,
your website states:

Compatible with any markup format.

I use AsciiDoctor, but I get a 404 and it states that the repo doesn't exist.
The website says that I should use the format: nicedoc.io/:org/:repo[@:ref]

when I do that for my repo, it would be: nicedoc.io/kreait/slack-spring-boot-starter
then, the error says that the repo github.com/slack-spring-boot-starter/kreait doesnt exist.
(org and repo are swapped)
so I tried to change the nicedoc URL to nicedoc.io/slack-spring-boot-starter/kreait
but the error stays the same.
it would be great if you have a hint on how to get the correct documentation, thank you!

Beautiful docs

Provide insights for improving README

Investigate how we can provide some insights about how to improve the READMe of any project

$ friction
/repo
 [ERROR] README not found                see http://git.io/yHosNA
 [ERROR] CONTRIBUTING guide not found    see http://git.io/g_0mVQ
 [ERROR] ISSUE_TEMPLATE not found        see http://git.io/vgpaA
 [ERROR] PULL_REQUEST_TEMPLATE not found see http://git.io/vgpVk
 [ERROR] CODE_OF_CONDUCT guide not found see http://git.io/vJvR3
 [ERROR] LICENSE not found               see http://git.io/pFMQMQ
 [ERROR] Bootstrap script not found      see http://git.io/jZoRYA
 [ERROR] Test script not found           see http://git.io/oo21Jw

Related

Add Table of Content

large viewport version

Table of Content

small viewport version

Table of Content (Small)

(sketch design)

Considerations

Expand subsection

Note how in the screenshot We are at Custom Endpoints subtitle inside Tips.

Because we are there, the Table of Content is showing subtitle inside Tips.

So the Table of Contents natural state is just showing the main titles. As soon as you are reading a subtitle, the subtitles are expanded.

Section has is reflected into the URL

In that case, because you are reading Custom Endpoints, the nicedoc url reflect that with the proper hash.

As soon as you read a different section, the hash into the URL will be updated for reflecting that.

Also, if you click into the GitHub icon for seeing the original README at GitHub, the url contain the hash as well.

Small Viewport

When the viewport is not enough big to place the Table of Contents properly it will be placed inside a lateral aside associated with a burger menu.

Inspiration

Use of unified

remark/rehype and other unified things are used here. Most of the code related to it is in the build/ directory.

@Kikobeats asked if I could review the code, so here goes, in an unordered list of things I came across.

Tips

Cheerio not needed

Everything cheerio is used for, rehype can also do. Cheerio is often easier, because it’s like the DOM, and thus more familiar to developers. It’s also used more, so probably less buggy. However, it’s heavy to load, and so is rehype, and functionalities overlap, so it’s probably better to pick one.

Move stuff to plugins and utilities when possible

...and publish them! So the rest of the unified community can benefit from them as well!

Is markdown linted?

import remarkPreset from 'remark-preset-lint-recommended'

A linting preset is used, is that needed? What’s done with the lint warnings?

Don’t use remark-html

https://github.com/IBM/nicedoc.io/blob/master/core/build/html.js

remark-html is essentially remark-rehype and rehype-stringify combined. But the downside is that you can’t use other rehype plugins in combination with it. So you need to parse the document again. Which is what’s happening in html.js.

You can instead use one processor like so:

export default async data => {
  const { contents: html } = await unified()
    .use(remarkParse)
    .use(remarkRehype)
    .use(rehypeSlug)
    .use(rehypePrism, { ignoreMissing: true, preLangClass: false })
    .use(rehypeStringify)
    .process(data)

  return html
}

Use unified instead of remark or rehype directly

remark is unified + remark-parse + remark-stringify, rehype is unified + rehype-parse + rehype-stringify. If you’re using a different -stringify, such as rehype-stringify, you are loading an unneeded stringier (remark-stringify).

If you use unified directly, it’s more explicit which parser and stringifier is used! And you won’t duplicate them.

unified supports promises!

No need to use util.promisify, .process(data) without a callback already returns a promise!

Syntax alias are not the same than GitHub

We are using prism syntax highlight and the language alias are different than default alias by GitHub.

Currently, if an alias is not resolved, it throws an error, causing a 500 error in the view.

Unknown language: `sh` is not registered
Error: Unknown language: `sh` is not registered
    at Refractor.highlight (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/refractor/core.js:89:13)
    at visitor (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/@mapbox/rehype-prism/index.js:29:26)
    at overload (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit/index.js:27:12)
    at one (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:29:16)
    at all (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:53:25)
    at one (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:37:14)
    at all (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:53:25)
    at one (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:37:14)
    at all (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:53:25)
    at one (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:37:14)
    at all (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:53:25)
    at one (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:37:14)
    at visitParents (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit-parents/index.js:22:3)
    at visit (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/unist-util-visit/index.js:22:3)
    at tree (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/@mapbox/rehype-prism/index.js:11:5)
    at wrapped (/Users/josefranciscoverdugambin/ibm/nicedoc.io/node_modules/trough/wrap.js:25:19)

Related: mapbox/rehype-prism#6

scroll-padding support

With a floating header, anchors to specific parts of the page are hidden behind the sticky bar, for example this.

There might be a CSS-based enhancement available to address this, but I haven't used scroll-padding before and I don't know how well it's supported, but at least for the browsers which do support it the experience should be much better.

Load README from GitHub

The GitHub API is exposing an endpoint for getting the readme of a repository:

https://developer.github.com/v3/repos/contents/#get-the-readme

example: https://api.github.com/repos/octokit/octokit.rb/readme

Then, we can fetch the download_file content.

Ideally, we want to get the HTML version of the markdown. That's could be done using media-types.

Another thing to consider is that the GitHub endpoint is returning the README for the master branch by default, doing that configurable using ref parameter.

We can reflect that as part of the app route:

  • /kikobeats/osom → Get README from master branch.
  • /kikobeats/osom@next → Get README from next branch.

Reflect theme into query string

The theme mode works saving a variable into localStorage.

Currently, there is not a way to update the value without entering in the website and toggle the theme selector.

It could be easily done retrieving the value for query string

https://nicedoc.io/Kikobeats/voll?theme=dark
https://nicedoc.io/Kikobeats/voll?theme=light

Better HTML/MD Parser

The current markdown processing workflow is:

  1. Getting MD for the GitHub API endpoint.
  2. Convert it into HTML.
  3. Monkey patching some things
    3.1 Convert links into absolute links
    3.2 Add anchors links
    3.4 Add zoom for images
    3.5...

Most of the monkey patching things can be done using remark plugins.

Also, it allows us do more powered things in order to normalize the content.

moar at https://github.com/remarkjs/awesome-remark

Nicedoc is not handling README links properly

What's happening

When I click on any link present on this README that is hosted on the Github repo itself, I got an error 500.

Maybe it's a consequence of the fact that Github adds blob/master to the file path, because if I remove that slug, things go perfect.

This issue maybe also related to #40

What's supposed to happen

Regardless the place where I am reading the documentation (Nicedoc or Github), every link should work properly.

Links to local files don’t work

(or don’t always work)

Take the readme of franc, https://nicedoc.io/wooorm/franc, at the bottom it links to the LICENSE file.
nicedoc generates a link with href="LICENSE" from that, which on nicedoc goes to https://nicedoc.io/wooorm/LICENSE (a 500 which should be a 404?)

Also thanks for using remark and unified!! 🤗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.