@brillout/docpress 0.1.20 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.js +1 -1
- package/{src/css/Inter-Var.ttf → dist/Inter-Var-IOAEQULN.ttf} +0 -0
- package/{src/components/Sponsors/companyLogos/ccoli.svg → dist/ccoli-CHW3TQKS.svg} +0 -0
- package/{src/icons/changelog.svg → dist/changelog-IPI5F42D.svg} +0 -0
- package/{src/navigation/navigation-fullscreen/chevron.svg → dist/chevron-K3WPYLOP.svg} +0 -0
- package/{src/components/features/chevron.svg → dist/chevron-R2IYJD62.svg} +0 -0
- package/dist/chunk-7HKDCMSZ.js +154 -0
- package/dist/chunk-7HKDCMSZ.js.map +1 -0
- package/dist/chunk-C3OIVLKV.js +75 -0
- package/dist/chunk-C3OIVLKV.js.map +1 -0
- package/dist/chunk-G2A5MZJA.js +48 -0
- package/dist/chunk-G2A5MZJA.js.map +1 -0
- package/dist/chunk-H5CO4N2X.js +174 -0
- package/dist/chunk-H5CO4N2X.js.map +1 -0
- package/dist/chunk-TTLAZ2T2.js +8 -0
- package/dist/chunk-TTLAZ2T2.js.map +1 -0
- package/dist/{chunk-ZYYJWJMY.js → chunk-XUTBTIEE.js} +15 -42
- package/dist/chunk-XUTBTIEE.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +35 -0
- package/dist/cli/index.js.map +1 -0
- package/{src/navigation/navigation-fullscreen/close.svg → dist/close-IQXTDOHV.svg} +0 -0
- package/{src/utils/Emoji/compass.svg → dist/compass-2RWQU3E4.svg} +0 -0
- package/{src → dist}/components/features/FeatureList.css +2 -7
- package/dist/components/features/FeatureList.css.map +1 -0
- package/dist/components/features/FeatureList.d.ts +13 -0
- package/dist/components/features/FeatureList.js +8 -0
- package/dist/components/features/FeatureList.js.map +1 -0
- package/dist/components/features/initFeatureList.d.ts +3 -0
- package/dist/components/features/initFeatureList.js +60 -0
- package/dist/components/features/initFeatureList.js.map +1 -0
- package/{src/components/Sponsors/companyLogos/contra.svg → dist/contra-WLZBOPBV.svg} +0 -0
- package/dist/{devServer-J2XJQJGT.js → devServer-534L4U45.js} +5 -2
- package/dist/{devServer-J2XJQJGT.js.map → devServer-534L4U45.js.map} +1 -1
- package/{src/icons/discord.svg → dist/discord-JD33TUSF.svg} +0 -0
- package/{src/utils/Emoji/engine.png → dist/engine-6Q6VSCVA.png} +0 -0
- package/{src/icons/github.svg → dist/github-P5ZSKN2N.svg} +0 -0
- package/{src/icons/heart.svg → dist/heart-OINVKOXO.svg} +0 -0
- package/dist/index.css +121 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +136 -0
- package/dist/index.js +459 -26
- package/dist/index.js.map +1 -1
- package/{src/components/Sponsors/label.svg → dist/label-MP75CTIA.svg} +0 -0
- package/{src/utils/Emoji/mechanical-arm.svg → dist/mechanical-arm-TR7IQQMG.svg} +0 -0
- package/{src/components/Sponsors/medalBronze.svg → dist/medalBronze-CO4CTUR4.svg} +0 -0
- package/{src/components/Sponsors/medalGold.svg → dist/medalGold-UP6A73FL.svg} +0 -0
- package/{src/components/Sponsors/medalSilver.svg → dist/medalSilver-FAPGGOBN.svg} +0 -0
- package/{src/components/Sponsors/companyLogos/mfqs.svg → dist/mfqs-2EAEE7N6.svg} +0 -0
- package/dist/renderer/_default.page.client.css +264 -0
- package/dist/renderer/_default.page.client.css.map +1 -0
- package/dist/renderer/_default.page.client.d.ts +1 -0
- package/dist/renderer/_default.page.client.js +180 -0
- package/dist/renderer/_default.page.client.js.map +1 -0
- package/dist/renderer/_default.page.server.css +312 -0
- package/dist/renderer/_default.page.server.css.map +1 -0
- package/dist/renderer/_default.page.server.d.ts +22 -0
- package/dist/renderer/_default.page.server.js +591 -0
- package/dist/renderer/_default.page.server.js.map +1 -0
- package/{src/utils/Emoji/road-fork.svg → dist/road-fork-3WZLW3HB.svg} +0 -0
- package/{src/utils/Emoji/shield.svg → dist/shield-CU45RG5C.svg} +0 -0
- package/{src/icons/twitter.svg → dist/twitter-I7DXDN3J.svg} +0 -0
- package/{src/utils/Emoji/typescript.svg → dist/typescript-ALIPKLRM.svg} +0 -0
- package/package.json +12 -9
- package/dist/chunk-ZYYJWJMY.js.map +0 -1
- package/src/MobileHeader.tsx +0 -68
- package/src/PageLayout.css +0 -41
- package/src/PageLayout.tsx +0 -37
- package/src/algolia/DocSearch.css +0 -29
- package/src/algolia/DocSearch.ts +0 -37
- package/src/autoScrollNav.ts +0 -22
- package/src/cli/devServer.ts +0 -31
- package/src/cli/index.ts +0 -29
- package/src/components/CodeBlock.tsx +0 -22
- package/src/components/DocLink.tsx +0 -108
- package/src/components/EditPageNote.tsx +0 -18
- package/src/components/HorizontalLine.tsx +0 -20
- package/src/components/ImportMeta.tsx +0 -11
- package/src/components/Info.tsx +0 -12
- package/src/components/Link.tsx +0 -18
- package/src/components/Note.tsx +0 -31
- package/src/components/P.css +0 -8
- package/src/components/P.tsx +0 -8
- package/src/components/ReadingRecommendation.tsx +0 -53
- package/src/components/RepoLink.tsx +0 -24
- package/src/components/Sponsors/companyLogos/ccoli-logo.svg +0 -1
- package/src/components/Sponsors/companyLogos/ccoli-text.svg +0 -1
- package/src/components/Sponsors/label.draft.svg +0 -108
- package/src/components/Sponsors.tsx +0 -242
- package/src/components/features/FeatureList.tsx +0 -114
- package/src/components/features/initFeatureList.ts +0 -66
- package/src/components/index.ts +0 -13
- package/src/config/Config.ts +0 -30
- package/src/config/getConfig.ts +0 -18
- package/src/config/resolveConfig/resolveHeading.ts +0 -0
- package/src/config/resolvePageContext.ts +0 -157
- package/src/css/button.css +0 -7
- package/src/css/code/block.css +0 -36
- package/src/css/code/inline.css +0 -27
- package/src/css/code.css +0 -20
- package/src/css/colorize-on-hover.css +0 -29
- package/src/css/font.css +0 -19
- package/src/css/heading.css +0 -25
- package/src/css/index.css +0 -11
- package/src/css/link.css +0 -17
- package/src/css/note.css +0 -26
- package/src/css/reset.css +0 -12
- package/src/css/table.css +0 -14
- package/src/css/tooltip.css +0 -11
- package/src/headings.ts +0 -200
- package/src/index.ts +0 -3
- package/src/installSectionUrlHashs.ts +0 -50
- package/src/markdownHeadingsVitePlugin.ts +0 -128
- package/src/navigation/Navigation-highlight.css +0 -41
- package/src/navigation/Navigation-items.css +0 -122
- package/src/navigation/Navigation-layout.css +0 -118
- package/src/navigation/Navigation.client.old.ts +0 -303
- package/src/navigation/Navigation.client.ts +0 -19
- package/src/navigation/Navigation.css +0 -12
- package/src/navigation/Navigation.tsx +0 -228
- package/src/navigation/NavigationHeader.tsx +0 -97
- package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.css +0 -32
- package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +0 -44
- package/src/navigation/navigation-fullscreen/initNavigationFullscreen.ts +0 -115
- package/src/parseEmojis.ts +0 -33
- package/src/renderer/_default.page.client.ts +0 -4
- package/src/renderer/_default.page.server.tsx +0 -69
- package/src/renderer/usePageContext.tsx +0 -25
- package/src/types.ts +0 -2
- package/src/utils/Emoji/Emoji.ts +0 -216
- package/src/utils/Emoji/assets.ts +0 -9
- package/src/utils/Emoji/index.ts +0 -1
- package/src/utils/Emoji/mountain.svg +0 -1
- package/src/utils/assert.ts +0 -39
- package/src/utils/client.ts +0 -2
- package/src/utils/crawlAllFiles.ts +0 -17
- package/src/utils/determineSectionUrlHash.ts +0 -35
- package/src/utils/filesystemPathHandling.ts +0 -42
- package/src/utils/filter.ts +0 -12
- package/src/utils/isBrowser.ts +0 -5
- package/src/utils/jsxToTextContent.ts +0 -11
- package/src/utils/objectAssign.ts +0 -9
- package/src/utils/server.ts +0 -8
- package/src/vite.config.ts +0 -44
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { assert } from './assert'
|
|
2
|
-
|
|
3
|
-
export { determineSectionUrlHash }
|
|
4
|
-
export { determineSectionTitle }
|
|
5
|
-
|
|
6
|
-
function determineSectionUrlHash(title: string): string {
|
|
7
|
-
const urlHash = title
|
|
8
|
-
.toLowerCase()
|
|
9
|
-
.split(/[^a-z0-9]+/)
|
|
10
|
-
.filter(Boolean)
|
|
11
|
-
.join('-')
|
|
12
|
-
return urlHash
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function determineSectionTitle(urlWithHash: string, titleNormalCase: boolean): string {
|
|
16
|
-
assert(urlWithHash.includes('#'), { urlWithHash })
|
|
17
|
-
const urlHash = urlWithHash.split('#')[1]
|
|
18
|
-
const title = urlHash
|
|
19
|
-
.split('-')
|
|
20
|
-
.map((word, i) => {
|
|
21
|
-
if (i === 0) {
|
|
22
|
-
return capitalizeFirstLetter(word)
|
|
23
|
-
}
|
|
24
|
-
if (!titleNormalCase && word.length >= 4) {
|
|
25
|
-
return capitalizeFirstLetter(word)
|
|
26
|
-
}
|
|
27
|
-
return word
|
|
28
|
-
})
|
|
29
|
-
.join(' ')
|
|
30
|
-
return title
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function capitalizeFirstLetter(word: string): string {
|
|
34
|
-
return word[0].toUpperCase() + word.slice(1)
|
|
35
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export { toPosixPath }
|
|
2
|
-
export { assertPosixPath }
|
|
3
|
-
export { toSystemPath }
|
|
4
|
-
|
|
5
|
-
import assert from 'assert'
|
|
6
|
-
|
|
7
|
-
const sepPosix = '/'
|
|
8
|
-
const sepWin32 = '\\'
|
|
9
|
-
|
|
10
|
-
function toPosixPath(path: string) {
|
|
11
|
-
if (isPosix()) {
|
|
12
|
-
assertPosixPath(path)
|
|
13
|
-
return path
|
|
14
|
-
}
|
|
15
|
-
if (isWin32()) {
|
|
16
|
-
const pathPosix = path.split(sepWin32).join(sepPosix)
|
|
17
|
-
assertPosixPath(pathPosix)
|
|
18
|
-
return pathPosix
|
|
19
|
-
}
|
|
20
|
-
assert(false)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function assertPosixPath(path: string) {
|
|
24
|
-
assert(path && !path.includes(sepWin32), `Wrongly formatted path: ${path}`)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function toSystemPath(path: string) {
|
|
28
|
-
if (isPosix()) {
|
|
29
|
-
return toPosixPath(path)
|
|
30
|
-
}
|
|
31
|
-
if (isWin32()) {
|
|
32
|
-
return path.split(sepPosix).join(sepWin32)
|
|
33
|
-
}
|
|
34
|
-
assert(false)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function isWin32() {
|
|
38
|
-
return process.platform === 'win32'
|
|
39
|
-
}
|
|
40
|
-
function isPosix() {
|
|
41
|
-
return !isWin32()
|
|
42
|
-
}
|
package/src/utils/filter.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { filter }
|
|
2
|
-
|
|
3
|
-
// https://stackoverflow.com/questions/66341757/typescript-how-to-filter-the-object
|
|
4
|
-
function filter<T extends object>(obj: T, predicate: <K extends keyof T>(value: T[K], key: K) => boolean): T {
|
|
5
|
-
const result: { [K in keyof T]?: T[K] } = {}
|
|
6
|
-
;(Object.keys(obj) as Array<keyof T>).forEach((name) => {
|
|
7
|
-
if (predicate(obj[name], name)) {
|
|
8
|
-
result[name] = obj[name]
|
|
9
|
-
}
|
|
10
|
-
})
|
|
11
|
-
return result as T
|
|
12
|
-
}
|
package/src/utils/isBrowser.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { assert } from './assert'
|
|
2
|
-
|
|
3
|
-
export { jsxToTextContent }
|
|
4
|
-
|
|
5
|
-
// https://stackoverflow.com/questions/34204975/react-is-there-something-similar-to-node-textcontent/60564620#60564620
|
|
6
|
-
function jsxToTextContent(node: JSX.Element | string): string {
|
|
7
|
-
if (['string', 'number'].includes(typeof node)) return String(node)
|
|
8
|
-
if (node instanceof Array) return node.map(jsxToTextContent).join('')
|
|
9
|
-
if (typeof node === 'object' && node) return jsxToTextContent(node.props.children)
|
|
10
|
-
assert(false)
|
|
11
|
-
}
|
package/src/utils/server.ts
DELETED
package/src/vite.config.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import mdx from '@mdx-js/rollup'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import ssr from 'vite-plugin-ssr/plugin'
|
|
4
|
-
import { UserConfig } from 'vite'
|
|
5
|
-
import { markdownHeadingsVitePlugin } from './markdownHeadingsVitePlugin'
|
|
6
|
-
import rehypePrettyCode from 'rehype-pretty-code'
|
|
7
|
-
import remarkGfm from 'remark-gfm'
|
|
8
|
-
|
|
9
|
-
const root = process.cwd()
|
|
10
|
-
const prettyCode = [rehypePrettyCode, { theme: 'github-light' }]
|
|
11
|
-
const rehypePlugins: any = [prettyCode]
|
|
12
|
-
const remarkPlugins = [remarkGfm]
|
|
13
|
-
|
|
14
|
-
const config: UserConfig = {
|
|
15
|
-
root,
|
|
16
|
-
plugins: [
|
|
17
|
-
react({
|
|
18
|
-
jsxRuntime: 'classic'
|
|
19
|
-
}),
|
|
20
|
-
markdownHeadingsVitePlugin(),
|
|
21
|
-
mdx({ rehypePlugins, remarkPlugins }),
|
|
22
|
-
ssr({
|
|
23
|
-
prerender: {
|
|
24
|
-
noExtraDir: true
|
|
25
|
-
},
|
|
26
|
-
// @ts-ignore until new version is released TODO
|
|
27
|
-
extensions: [{
|
|
28
|
-
npmPackageName: '@brillout/docpress',
|
|
29
|
-
pageFilesSrc: '/src/renderer/*',
|
|
30
|
-
}],
|
|
31
|
-
includeAssetsImportedByServer: true,
|
|
32
|
-
disableAutoFullBuild: true
|
|
33
|
-
})
|
|
34
|
-
],
|
|
35
|
-
// TODO: remove `react`?
|
|
36
|
-
optimizeDeps: { include: ['@mdx-js/react', 'react', 'react-dom'] },
|
|
37
|
-
// @ts-ignore
|
|
38
|
-
ssr: {
|
|
39
|
-
noExternal: ['@brillout/docpress']
|
|
40
|
-
},
|
|
41
|
-
clearScreen: false
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default config
|