Skip to content

Commit

Permalink
chore(website): add option to hide code sources
Browse files Browse the repository at this point in the history
  • Loading branch information
donskov committed Jan 11, 2024
1 parent b9f5e0f commit 1689504
Show file tree
Hide file tree
Showing 27 changed files with 465 additions and 556 deletions.
4 changes: 2 additions & 2 deletions website/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

**/docs/**/*.md
**/docs/**/*.yml

/docs/api/
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Create and validate certificate

In this example, you will see how to create a self-signed X.509 certificate, parse an X.509 certificate, and show how to do certificate chain validation engine
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Creating and parsing CRLs

In this example, you will see how to create a CRL, parse, and validate it.
5 changes: 5 additions & 0 deletions website/docs/examples/certificates-and-revocation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DocCardList from '@theme/DocCardList';

# Certificates and Revocation

<DocCardList />
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with OCSP requests

In this example, you will see how to create and parse OCSP requests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with OCSP responses

In this example, you will see how to create and parse OCSP responses.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with certificate requests

In this example, you will see how to create a CSR, parse it and verify its signature.
3 changes: 3 additions & 0 deletions website/docs/examples/other/S-MIME-signature-encryption.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# S/MIME signature encryption

In this example, you will see how to encrypt S/MIME messages.
3 changes: 3 additions & 0 deletions website/docs/examples/other/S-MIME-signature-verification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# S/MIME signature verification

In this example, you will see how to verify S/MIME messages.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# How to verify a signature in a PDF file

In this example, you will see how to verify signatures inside PDF files.
5 changes: 5 additions & 0 deletions website/docs/examples/other/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DocCardList from '@theme/DocCardList';

# Other

<DocCardList />
3 changes: 3 additions & 0 deletions website/docs/examples/other/working-with-PKCS-12-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with PKCS#12 files

In this example, you will see how to create a PKCS#12 (sometimes called a PFX) and parse it.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DocCardList from '@theme/DocCardList';

# Signing and Encryption with CMS

<DocCardList />
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with CMS Certificate-based Encryption

In this example, you will see how to create and decrypt an Enveloped CMS message using an existing X.509 certificate.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with CMS password-based Encryption

In this example, you will see how to create and decrypt a pre-shared key encrypted CMS message.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with CMS Signing

In this example, you will see how to sign any file using CMS.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Working with PKCS#7 Certificate bags (P7B)

In this example, you will see how to create a "certificate bag"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Creating a Timestamp request

In this example, you will see how to create and parse a timestamp request.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Creating a Timestamp response

In this example, you will see how to create, parse and verify timestamp responses.
5 changes: 5 additions & 0 deletions website/docs/examples/timestamping/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import DocCardList from '@theme/DocCardList';

# Timestamping

<DocCardList />
7 changes: 7 additions & 0 deletions website/docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Installation

Run one of the following commands to add `pkijs` to your project:

```bash npm2yarn
npm install pkijs
```
20 changes: 17 additions & 3 deletions website/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {Config} from '@docusaurus/types';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import npm2yarn from '@docusaurus/remark-plugin-npm2yarn';

const config: Config = {
title: 'pki.js',
Expand Down Expand Up @@ -27,9 +28,15 @@ const config: Config = {
[
'classic',
{
docs: {
path: 'docs',
sidebarPath: './sidebars.ts',
remarkPlugins: [npm2yarn],
},
theme: {
customCss: './src/css/custom.css',
},
blog: false,
} satisfies Preset.Options,
],
],
Expand Down Expand Up @@ -64,9 +71,16 @@ const config: Config = {
},
items: [
{
label: 'API',
to: '/docs/api',
type: 'docSidebar',
position: 'right',
sidebarId: 'docs',
label: 'Docs',
},
{
type: 'docSidebar',
position: 'right',
sidebarId: 'examples',
label: 'Examples',
},
{
href: 'https://github.com/PeculiarVentures/PKI.js',
Expand Down
13 changes: 7 additions & 6 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@
"typecheck": "tsc"
},
"dependencies": {
"@docusaurus/core": "3.0.0",
"@docusaurus/preset-classic": "3.0.0",
"@docusaurus/core": "3.1.0",
"@docusaurus/remark-plugin-npm2yarn": "3.1.0",
"@docusaurus/preset-classic": "3.1.0",
"@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1",
"prism-react-renderer": "^2.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.0.0",
"@docusaurus/tsconfig": "3.0.0",
"@docusaurus/types": "3.0.0",
"@docusaurus/module-type-aliases": "3.1.0",
"@docusaurus/tsconfig": "3.1.0",
"@docusaurus/types": "3.1.0",
"docusaurus-plugin-sass": "^0.2.5",
"docusaurus-plugin-typedoc": "^0.21.0",
"docusaurus-plugin-typedoc": "^0.22.0",
"sass": "^1.69.5",
"typedoc": "^0.25.3",
"typedoc-plugin-markdown": "^3.17.1",
Expand Down
39 changes: 17 additions & 22 deletions website/sidebars.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,26 @@
import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';

/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/
const sidebars: SidebarsConfig = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],

// But you can create a sidebar manually
/*
tutorialSidebar: [
'intro',
'hello',
docs: [
'installation',
{
type: 'category',
label: 'Tutorial',
items: ['tutorial-basics/create-a-document'],
label: 'API',
collapsed: false,
items: [
{
type: 'autogenerated',
dirName: 'api',
},
],
},
],
*/
examples: [
{
type: 'autogenerated',
dirName: 'examples',
}
],
};

export default sidebars;
27 changes: 14 additions & 13 deletions website/src/pages/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@
z-index: 1;
color: white;
max-width: 770px;
}

h1 {
margin-bottom: 40px;
}
display: flex;
flex-direction: column;
gap: 40px;

p {
margin: 0;
> * {
margin: 0;
}
}
}

Expand All @@ -84,14 +83,16 @@
display: grid;
grid-template-columns: repeat(3,1fr);
grid-gap: 80px 7.5vw;
}

h4 {
margin-bottom: 22px;
}
* {
margin: 0;
}

p {
margin: 0;
li {
display: flex;
flex-direction: column;
gap: 22px;
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions website/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import Layout from '@theme/Layout';
import Link from '@docusaurus/Link';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import FeaturesList from './_features.md';
import Preview from './_preview.md';
Expand All @@ -16,6 +17,15 @@ export default function Home() {
<div className={s.m_width}>
<div className={s.preview_content}>
<Preview />

<div>
<Link
to="/docs/installation"
className="button button--secondary button--lg"
>
Get started ➞
</Link>
</div>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 1689504

Please sign in to comment.