Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Aug 16, 2023
1 parent 6baa9ff commit 390fad5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 37 deletions.
62 changes: 29 additions & 33 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,30 @@
<div id="app"></div>
<div
id="docs"
class="docs bg-gray-300 text-dark @dark:bg-gray-700 @dark:text-white py-8"
class="docs bg-gray-300 text-dark @dark:bg-gray-800 @dark:text-white py-8"
>
<div
class="mb-2 px-4 flex flex-col md:flex-row w-full max-w-6xl mx-auto gap-6"
>
<section class="md:w-1/2 mb-2">
<h2>What is publint?</h2>
<p>
<code>publint</code> lints npm packages for packaging errors,
ensuring maximum compatibility across environments. This means that
consumers of your package can safely run your code in any platform,
e.g. Vite, Webpack, Rollup, Node.js, etc.
<code>publint</code> lints npm packages to ensure widest
compatibility across environments, such as Vite, Webpack, Rollup,
Node.js, etc.
</p>
<p>
A full list of rules can be found at the
<a class="anchor-link-with-hint" href="/rules.html"> rules page </a>
.
A full list of lint rules can be found at the
<a class="anchor-link-with-hint" href="/rules.html">rules page</a>.
</p>
</section>
<section class="md:w-1/2 mb-2">
<h2>How it works</h2>
<p>
When linting an npm package, the site downloads the package tarball
locally from the npm registry, then a web worker will run the
<code>publint</code> CLI against the files. For larger packages, it
may take a while to download and lint.
</p>
<p>
Unlike <code>npm install</code>, the site would only download the
package itself without it's dependencies, as that's sufficient for
the linting process.
When linting an npm package, the site downloads the tarball from the
npm registry, and runs <code>publint</code> against it in a web
worker. For larger packages, it may take a while to download and
lint.
</p>
</section>
</div>
Expand All @@ -50,24 +43,27 @@ <h2>How it works</h2>
>
<section class="md:w-1/2 mb-2">
<h2>Use locally</h2>
<p>
In the root of your library directory, run
<code>npx publint</code>! If you're an end-user and would like to
lint the dependencies you use instead, run
<code>npx publint deps</code>. Use
<code>npx publint --help</code> to see the full list of options.
</p>
<ul>
<li>
Run <code>npx publint</code> in your library directory to lint
locally.
</li>
<li>Run <code>npx publint --deps</code> to lint dependencies.</li>
<li>Run <code>npx publint --help</code> for the full list of options.</li>
</ul>
</section>
<section class="md:w-1/2 mb-2">
<h2>Other tools</h2>
<p>
<a
class="anchor-link-with-hint"
href="https://arethetypeswrong.github.io"
>
Are the types wrong?
</a>
</p>
<h2>Other resources</h2>
<ul>
<li>
<a
class="anchor-link-with-hint"
href="https://arethetypeswrong.github.io"
>
Are the types wrong?
</a>
</li>
</ul>
</section>
</div>
<footer class="text-center">
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Analysis.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
<!-- fade shadow -->
{#if !open}
<div
class="absolute bottom-0 w-full h-32 bg-gradient-to-b from-transparent to-gray-300 @dark:to-gray-700 pointer-events-none"
class="absolute bottom-0 w-full h-32 bg-gradient-to-b from-transparent to-gray-300 @dark:to-gray-800 pointer-events-none"
></div>
<div
class="blur-mask absolute bottom-0 w-full h-28 backdrop-blur pointer-events-none"
Expand Down
5 changes: 5 additions & 0 deletions site/src/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ body {
visibility: visible;
}

.docs ul {
margin: 0;
padding-left: 1.2rem;
}

.docs li {
line-height: 1.5;
opacity: 0.8;
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<p class="my-8">
<a class="anchor-link" href="#docs">How it works</a>
<strong class="inline-block mx-1">·</strong>
<a class="anchor-link" href="/rules.html">Rules</a>
<a class="anchor-link" href="/rules.html">Lint rules</a>
</p>
</section>
{#if analysis}
Expand Down
5 changes: 3 additions & 2 deletions site/unocss.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ export default defineConfig({
},
shortcuts: {
'anchor-link':
'font-medium decoration-none hover:text-primary-dark focus:text-primary-dark @dark:hover:text-primary-light @dark:focus:text-primary-light transition-color',
'anchor-link-with-hint': 'anchor-link text-primary',
'font-medium decoration-none hover:text-primary-dark focus:text-primary-dark @dark:hover:text-primary @dark:focus:text-primary transition-color',
'anchor-link-with-hint':
'anchor-link text-primary @dark:text-primary-light',
'action-button':
'font-medium decoration-none px-4 py-3 border-none rounded hover:bg-primary-light focus:bg-primary-light @dark:hover:bg-primary @dark:focus:bg-primary transition-background-color cursor-pointer'
}
Expand Down

0 comments on commit 390fad5

Please sign in to comment.