Skip to content

Commit

Permalink
feat: Added typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Aug 20, 2021
1 parent 91e3f3f commit c862697
Show file tree
Hide file tree
Showing 8 changed files with 366 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.tgz
/debug.log
dist/
node_modules
/dist/
/docs
/node_modules
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
docs-source
html
11 changes: 11 additions & 0 deletions docs-source/layouts/analytics.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{#if settings.gaID}}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src='https://www.googletagmanager.com/gtag/js?id={{settings.gaID}}'
></script>
<script>
window.dataLayer = window.dataLayer || []; function
gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{{settings.gaID}}');
</script>
{{/if}}
51 changes: 51 additions & 0 deletions docs-source/layouts/default.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{{#ifCond model.name '==' project.name}}{{project.name}}{{else}}{{model.name}} | {{project.name}}{{/ifCond}}</title>
<meta name="description" content="Documentation for {{project.name}}">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="{{relativeURL "assets/css/main.css"}}">
<link rel="stylesheet" href="{{relativeURL "assets/css/pages.css"}}">
<script async src="{{relativeURL "assets/js/search.js"}}" id="search-script"></script>

{{> analytics}}
</head>
<body>

{{> header}}

<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
{{{contents}}}
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
{{#each navigation.children}}
{{> navigation}}
{{/each}}
</ul>
</nav>

<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
{{#each toc.children}}
{{> toc.root}}
{{/each}}
</ul>
</nav>
</div>
</div>
</div>

{{> footer}}

<div class="overlay"></div>
<script src="{{relativeURL "assets/js/main.js"}}"></script>

</body>
</html>
53 changes: 53 additions & 0 deletions docs-source/layouts/fix-docs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*!
* Copyright 2021 WPPConnect Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as path from 'path';
import * as shell from 'shelljs';

const nodeModulesDir = path.resolve(__dirname, '../../node_modules/');

// Pages Theme Plugin
const pagesThemeDir = path.resolve(
nodeModulesDir,
'typedoc-plugin-pages/dist/theme/v2'
);
// Default Theme
const defaultTheme = path.resolve(
nodeModulesDir,
'typedoc-default-themes/bin/default'
);

// Fix Theme
// shell.cp(path.resolve(defaultTheme, './partials/type.hbs'), path.resolve(pagesThemeDir, './partials/'));
shell.cp(
path.resolve(defaultTheme, './partials/*'),
path.resolve(pagesThemeDir, './partials/')
);
shell.cp(
'-R',
path.resolve(defaultTheme, './assets/*'),
path.resolve(pagesThemeDir, './assets/')
);

// Google Analytics
shell.cp(
path.resolve(__dirname, './analytics.hbs'),
path.resolve(pagesThemeDir, './partials/')
);
shell.cp(
path.resolve(__dirname, './default.hbs'),
path.resolve(pagesThemeDir, './layouts/')
);
Loading

0 comments on commit c862697

Please sign in to comment.