dochub 1.0.1 → 1.0.3
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/index.js +1 -1
- package/package.json +1 -1
- package/src/init.js +4 -4
- package/templates/README.md +1 -1
- package/templates/server.js +5 -1
package/index.js
CHANGED
package/package.json
CHANGED
package/src/init.js
CHANGED
@@ -95,9 +95,8 @@ function createMarkdownFiles(folderPath) {
|
|
95
95
|
// Function to create config.json
|
96
96
|
function createConfigFile(filePath) {
|
97
97
|
const configData = {
|
98
|
-
title: '
|
99
|
-
description:
|
100
|
-
// Add more configuration as needed
|
98
|
+
title: 'DocHub Project',
|
99
|
+
description: "Change this to your description!"
|
101
100
|
};
|
102
101
|
|
103
102
|
fs.writeFileSync(filePath, JSON.stringify(configData, null, 2));
|
@@ -152,6 +151,7 @@ function initializeNpm(projectPath) {
|
|
152
151
|
start: 'node server.js'
|
153
152
|
},
|
154
153
|
keywords: [],
|
154
|
+
"main": "server.js",
|
155
155
|
author: '',
|
156
156
|
license: 'ISC'
|
157
157
|
};
|
@@ -169,7 +169,7 @@ function initializeNpm(projectPath) {
|
|
169
169
|
|
170
170
|
// Function to install necessary packages
|
171
171
|
function installPackages(projectPath) {
|
172
|
-
const dependencies = ['http', 'fs', 'path', 'highlight.js', 'socket.io'];
|
172
|
+
const dependencies = ['http', 'fs', 'path', 'highlight.js', 'socket.io'];
|
173
173
|
|
174
174
|
animatedLog(`✔ Installing packages: ${dependencies.join(', ')}`, 50);
|
175
175
|
const progressBar = createProgressBar(20);
|
package/templates/README.md
CHANGED
@@ -36,7 +36,7 @@ The project structure includes:
|
|
36
36
|
|
37
37
|
## Getting Help
|
38
38
|
|
39
|
-
If you encounter any issues or have questions about using this documentation project, feel free to reach out via [GitHub Issues](https://github.com/
|
39
|
+
If you encounter any issues or have questions about using this documentation project, feel free to reach out via [GitHub Issues](https://github.com/tyler-Github/dochub/issues).
|
40
40
|
|
41
41
|
## License
|
42
42
|
|
package/templates/server.js
CHANGED
@@ -6,6 +6,10 @@ const socketio = require('socket.io');
|
|
6
6
|
|
7
7
|
let htmlContent = ''; // Variable to store HTML content
|
8
8
|
|
9
|
+
const configPath = path.join(__dirname, 'config.json');
|
10
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
11
|
+
const projectTitle = config.title || 'Documentation Project';
|
12
|
+
|
9
13
|
// Function to convert Markdown to HTML
|
10
14
|
function convertMarkdownToHtml(markdownContent, filePath) {
|
11
15
|
// Regular expression to match Markdown code blocks
|
@@ -104,7 +108,7 @@ function convertMarkdownToHtml(markdownContent, filePath) {
|
|
104
108
|
</head>
|
105
109
|
<body class="flex bg-gray-100">
|
106
110
|
<aside class="w-1/5 bg-gray-800 p-4 sidebar">
|
107
|
-
<h1 class="text-xl font-bold mb-4"
|
111
|
+
<h1 class="text-xl font-bold mb-4">${projectTitle}</h1>
|
108
112
|
<input type="text" id="search-input" class="search-bar" placeholder="Search...">
|
109
113
|
<ul id="sidebar-list" class="space-y-2">
|
110
114
|
${sidebar}
|