Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: documentation website #320

Closed
wants to merge 1 commit into from
Closed

Conversation

satya164
Copy link
Member

@satya164 satya164 commented Feb 24, 2019

TODO

  • Add syntax highlighting for CSS literals in component-docs
  • Make a homepage for the docs website
  • Publish docs in linaria.now.sh/docs or maybe github pages?
  • Publish docs on CI
  • Add logo in sidebar

@callstack-bot
Copy link

callstack-bot commented Feb 25, 2019

Hey @satya164, thank you for your pull request 🤗.
The coverage report for this branch can be viewed here.

@pbitkowski pbitkowski self-assigned this May 16, 2019
@jayu
Copy link
Contributor

jayu commented Apr 14, 2020

@satya164 What is the status of it? Should it be closed or can it be continued?

@jayu jayu added the needs: response 📩 Response from author/commenters is requested label Apr 14, 2020
@satya164
Copy link
Member Author

I think someone can pick it up and continue

@jayu jayu removed the needs: response 📩 Response from author/commenters is requested label Apr 16, 2020
@trongthanh
Copy link
Contributor

Can I pick this up since we're adopting Linaria for my team project and have the need to check up documentation constantly but current markdown files are not convenient enough.

@satya164
Copy link
Member Author

@trongthanh feel free to pick it up. what I had trouble with is to figure out how to add syntax highlighting for CSS literals and didn't have enough time to investigate. lemme know if we need any changes in component-docs to support it.

@trongthanh
Copy link
Contributor

@satya164,

I've looked into component-docs and the refractor / Prism.js library used beneath for syntax highlighting and found that in order to highlight CSS-in-JS, we need to register the additional language extension js-templates.

I guess they only added this template string highlighting recently and after this PR.

I've tried it with following patch to the highlight.js file:

...
  refractor.register(require('refractor/lang/javascript'));
+ refractor.register(require('refractor/lang/js-extras'));
+ refractor.register(require('refractor/lang/js-templates'));
  refractor.register(require('refractor/lang/typescript'));
...

The optional package js-extras is to support modern ECMAScript syntax and is not related to the CSS-in-JS fix.

Here's proof that it's working:
image

@satya164
Copy link
Member Author

@trongthanh awesome! would be cool if you added that in a PR and I'll make a release.

@trongthanh
Copy link
Contributor

Before I open a PR, I'd like to clarify my intention regarding renaming of the MD files. So, as per this PR, the markdowns are renamed with order number so that they are deliberately sorted in a file glob pattern. However, with component-docs config file, we can also explicitly define the markdowns order like so:

const path = require('path');

module.exports = {
  pages: [
    { type: 'mdx', file: path.resolve(__dirname, 'docs/HOME.mdx') },
    { type: 'md', file: path.resolve(__dirname, 'docs/GET_STARTED.md') },
    { type: 'md', file: path.resolve(__dirname, 'docs/BASICS.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/BENEFITS.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/API.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/CONFIGURATION.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/CLI.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/BUNDLERS_INTEGRATION.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/LINTING.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/CRITICAL_CSS.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/DYNAMIC_STYLES.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/THEMING.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/HOW_IT_WORKS.md')},
    { type: 'md', file: path.resolve(__dirname, 'docs/2.0_MIGRATION_GUIDE.md')},
  ]
};

To avoid renaming current markdown files as well as because component-docs is currently having this CLI pages glob issue, I'd like to suggest that we add component-docs.config.js to the project to define the pages structure with it.

The downside is that we have to manually add new entries when there are new MD.

@satya164
Copy link
Member Author

satya164 commented Nov 2, 2020

I'll look at the glob issue, but let's keep the config file since we'd want more organization such as sections (Guides, API Reference etc.).

Though would be good to have an array like following and then generate pages array from it:

[
  'Home.mdx',
  'GET_STARTED.md',
  ...
]

@satya164 satya164 closed this Feb 6, 2024
@satya164 satya164 deleted the @satya164/component-docs branch February 6, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants