GithubHelp home page GithubHelp logo

egoist / docup Goto Github PK

View Code? Open in Web Editor NEW
704.0 7.0 32.0 1.04 MB

The easiest way to write beautiful docs.

Home Page: https://docup.egoist.dev

License: MIT License

JavaScript 0.89% CSS 26.68% TypeScript 70.92% HTML 1.51%

docup's Introduction

Docup

Docup is a single JavaScript file that fetches Markdown file and renders it as a beautiful one-page documentation.

Docup is built with Preact, the entire bundle (with CSS) is just 30kB minified and gzipped.

View Documentation

Donate

Liense

MIT © EGOIST (Kevin Titor)

docup's People

Contributors

0xflotus avatar blesstosam avatar dependabot-preview[bot] avatar egoist avatar jeff-foster avatar jozanza avatar splode avatar yisar 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

docup's Issues

Scrolling up from bottom doesn't update hash

  • Right now, if you scroll down and go back to the top, #quick-start is kept in the hash
  • If you go to https://docup.now.sh/#embeding for example and start to scroll up, technically you're already reading "Message Blocks", but the hash/active link doesn't change until you reach the header.

It's probably related to the headings being used as targets https://github.com/egoist/docup/blob/master/src/components/App.tsx#L13

Wrapping the sections with an element like a div could solve these issues.

Nice project btw 🎉

Support spa route.

GitHub Pages doesn't support rewrites like something in vercel

{
  "rewrites": [
    {
      "source": "/(.*)",
      "destination": "/index.html"
    }
  ]
}

Maybe docup can support spa route?
It means for the following config:

{
        text: "中文",
        link: "zh",
}

Docup will fetch zh.md directly instead of jump to /zh

Hidden H2s still appear in Menu component

Hiding H2s via comments will prevent them from being shown in main content area, however they still appear in the menu section. This can reproduced by taking the boilerplate index.html (described in the "Quick Start" instructions), and creating a README.md with the following content.

# Title

lorem ipsum ...

<!-- hide-on-docup-start -->

## Table of Contents

- [Installation](#installation)
- [Getting Started](#getting-started)

<!-- hide-on-docup-stop -->

## Installation

`npm i some-package`

## Getting Started

blah blah blah

The generated website will show three sections in the menu: "Table of Contents", "Installation", and "Getting Started". My expectation is that it would only show the latter two.

Prerender

Create a CLI to prerender a docup site into static files, so it fetches and renders markdown at build time rather than in browser (optionally allow to disable js)

Logo design

Docup sounds like a cup of tea (or coffee), maybe that's a good start point for the logo.

Strip HTML tags from README.md

Stripe HTML tags in headings, to ignore badges.

For example:

# [React](https://reactjs.org/) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/master/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![Coverage Status](https://img.shields.io/coveralls/facebook/react/master.svg?style=flat)](https://coveralls.io/github/facebook/react?branch=master) [![CircleCI Status](https://circleci.com/gh/facebook/react.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/facebook/react) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://reactjs.org/docs/how-to-contribute.html#your-first-pull-request)

React is a JavaScript library for building user interfaces.

* **Declarative:** React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
* **Component-Based:** Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep state out of the DOM.
* **Learn Once, Write Anywhere:** We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code. React can also render on the server using Node and power mobile apps using [React Native](https://facebook.github.io/react-native/).

[Learn how to use React in your own project](https://reactjs.org/docs/getting-started.html).

## Documentation

You can find the React documentation [on the website](https://reactjs.org/docs).  
It is divided into several sections:

* [Quick Start](https://reactjs.org/docs/hello-world.html)
* [Advanced Guides](https://reactjs.org/docs/jsx-in-depth.html)
* [API Reference](https://reactjs.org/docs/react-api.html)
* [Tutorial](https://reactjs.org/tutorial/tutorial.html)
* [Where to Get Support](https://reactjs.org/community/support.html)
* [Contributing Guide](https://reactjs.org/docs/how-to-contribute.html)

You can improve it by sending pull requests to [this repository](https://github.com/reactjs/reactjs.org).

Publish esm bundle only

The next major release (2.0.0) will only contain the esm version of docup, i.e. the umd version will be removed.

Use throttle instead of debounce

When scrolling, the current behavior looks laggy because debounce actually only fires after 200ms have passed since the last scroll.

Using throttle, with the same 200ms delay, it would fire every 200ms.

It would still avoid performance problems, but give a more instant feedback (you could even make it fire every 100ms).

I'm talking about this line https://github.com/egoist/docup/blob/master/src/components/App.tsx#L12

Here's an example of the behavior of debounce and throttle https://codepen.io/chriscoyier/pen/vOZNQV

Run specific code blocks

```js,console
console.log('12')
```

```js,html
document.write('12')
```

```js,console,html
console.log('12')
document.write('12')
```

Alert messages

We can transform:

> **TAG**: This is a alert!

Into:

<p class="Tag">This is a alert!</p>

About mdx support

Hi, @egoist , thank you for continuously creating high quality OSS, docup looks easy to use.

Is it possible for docup to support .mdx document in the future?

Easier "Google-able" name instead of docup?

Really cool project that does one thing well. Thanks!
However, would it be nice to have a name that is easier to Google and is not the same as another npm package or a document management company in India?
Image
Just my two cents.

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.