Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3d3e386
added toc functionality
Oct 13, 2017
fec8934
corrected toc version
Oct 13, 2017
3eadc67
tried to add tocbot without success
Oct 13, 2017
9b50e6e
first version of publicly working tocbot theme.
rklasen Oct 15, 2017
df264cd
added theme files
rklasen Oct 15, 2017
8cdbbce
added a tocbot refresh after anchors are included
rklasen Oct 15, 2017
308e41a
changed behaviour of tocbot.refresh() because it broke pages without …
rklasen Oct 15, 2017
b3fc5f9
changed session timeout to 30 days
Oct 27, 2017
6ca4e16
Merge branch 'master' of github.com:rklasen/openKB
Oct 27, 2017
0b75d04
modified breakpoints for small, medium and large
Nov 16, 2017
e4b5043
resolved locales
Nov 16, 2017
7caed48
try to add search by tag only
rklasen Nov 16, 2017
2eaf64e
sync working version to head
Nov 16, 2017
c7256b8
Merge branch 'master' of github.com:rklasen/openKB
Nov 16, 2017
83dba90
added tags view
rklasen Nov 16, 2017
1a84c4e
Merge branch 'master' of github.com:rklasen/openKB
rklasen Nov 16, 2017
dcf79fb
test: change article view
rklasen Nov 16, 2017
24a2662
changed search by topic
Nov 17, 2017
e26c8e6
search by topic now works
Nov 17, 2017
47488c5
fixed layout on topic search
rklasen Nov 17, 2017
c7251a7
changed homepage to display article with title Homepage
rklasen Nov 17, 2017
5ab0e97
some change to locale again
Nov 17, 2017
0cdf6da
some change to locale again
Nov 17, 2017
370bf6b
update
rklasen Nov 17, 2017
1ac848c
Merge branch 'master' of github.com:rklasen/openKB
rklasen Nov 17, 2017
9fec42d
current version
Nov 26, 2017
c802433
updated gitignore
Nov 26, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ data/users.db
data/sessions.db
data/kb.db
data/votes.db
data/backup.tar
Rubbish/
public/images/
public/uploads/
Expand Down
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ handlebars = handlebars.create({
var array = keywords.split(','); var links = '';
for(var i = 0; i < array.length; i++){
if(array[i].trim() !== ''){
links += '<a href="' + app_context + '/search/' + array[i].trim() + '">' + array[i].trim() + '</a> <span class="keywordSeporator">|</span> ';
links += '<a href="' + app_context + '/topic/' + array[i].trim() + '">' + array[i].trim() + '</a> <span class="keywordSeporator">|</span> ';
}
}return links.substring(0, links.length - 1);
}
Expand Down Expand Up @@ -217,7 +217,7 @@ app.use(session({
cookie: {
path: '/',
httpOnly: true,
maxAge: 3600000 * 24
maxAge: 3600000 * 24 * 30
},
store: new Nedb_store({
filename: 'data/sessions.db'
Expand Down
26 changes: 13 additions & 13 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"settings": {
"route_name": "kb",
"num_top_results": "10",
"num_top_results": "8",
"date_format": "DD/MM/YYYY h:mmA",
"show_view_count": true,
"update_view_count_logged_in": false,
"update_view_count_logged_in": true,
"show_published_date": true,
"sort_by": {
"field": "kb_viewcount",
"order": -1
},
"website_title": "openKB",
"website_title": "RemusKB",
"show_featured_articles": true,
"show_featured_in_article": false,
"featured_articles_count": "4",
"password_protect": false,
"show_kb_meta": true,
"suggest_allowed": true,
"show_author_email": true,
"mermaid": false,
"mathjax": false,
"password_protect": true,
"show_kb_meta": false,
"suggest_allowed": false,
"show_author_email": false,
"mermaid": true,
"mathjax": true,
"mathjax_input_mode": "TeX-MML-AM_CHTML",
"app_context": "",
"links_blank_page": true,
"database": {
"type": "embedded"
},
"allow_voting": true,
"allow_voting": false,
"google_analytics": "",
"theme": "",
"show_logon": true,
"add_header_anchors": false,
"typeahead_search": true,
"index_article_body": false,
"index_article_body": true,
"enable_spellchecker": true,
"show_website_logo": true,
"website_description": "openKB is an Open Source Node.js Markdown based knowledge base/FAQ/Wiki app with powerful lunr search",
"show_website_logo": false,
"website_description": "RemusKB needs no description. ",
"article_versioning": false,
"api_auth_token": "",
"api_allowed": false,
Expand Down
137 changes: 52 additions & 85 deletions locales/en.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
{
"Search the knowledge base": "Search the knowledge base",
"Search": "Search",
"Featured articles": "Featured articles",
"Topic": "Topic",
"Date": "Date",
"View count": "View count",
"Powered by": "Powered by",
"Toggle navigation": "Toggle navigation",
"Users": "Users",
"New": "New",
"Edit": "Edit",
"My account": "My account",
"Article": "Article",
"Admin": "Admin",
"Settings": "Settings",
"Files": "Files",
"Import": "Import",
"Export": "Export",
"Cleanup files": "Cleanup files",
"Logout": "Logout",
"Powered by": "Powered by",
"Cannot find module 'markdown-it-sub'": "Cannot find module 'markdown-it-sub'",
"Login": "Login",
"Not Found": "Not Found",
"Top articles": "Top articles",
"403 - Forbidden": "403 - Forbidden",
"Home": "Home",
"Articles": "Articles",
"Filter articles": "Filter articles",
"Filter": "Filter",
"Reset": "Reset",
"All": "All",
"Articles by Tag": "Articles by Tag",
"Published": "Published",
"Recent": "Recent",
"Are you sure you want to delete this article?": "Are you sure you want to delete this article?",
"Search": "Search",
"Featured articles": "Featured articles",
"Top articles": "Top articles",
"Suggest": "Suggest",
"Login": "Login",
"Please sign in": "Please sign in",
"email address": "email address",
"Password": "Password",
"Sign in": "Sign in",
"Results for": "Results for",
"ifboth doesn't match if - 23:4": "ifboth doesn't match if - 23:4",
"options.fn is not a function": "options.fn is not a function",
"((helpers.routeType || (depth0 && depth0.routeType)) || alias2).call is not a function": "((helpers.routeType || (depth0 && depth0.routeType)) || alias2).call is not a function",
"No results found": "No results found",
"Parse error on line 72:\n...{{this.kb_title}} {{__\", has Topics \"}} \n-----------------------^\nExpecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'": "Parse error on line 72:\n...{{this.kb_title}} {{__\", has Topics \"}} \n-----------------------^\nExpecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID'",
", has Topics ": ", has Topics ",
"Website": "Website",
"Display": "Display",
"Style": "Style",
"Update": "Update",
"Website title": "Website title",
"The title of your website": "The title of your website",
Expand All @@ -39,33 +47,35 @@
"Show website logo": "Show website logo",
"true": "true",
"false": "false",
"Controls whether to show the 'Website title' text or a logo located: '/public/logo.png' (by default)": "Controls whether to show the 'Website title' text or a logo located: '/public/logo.png' (by default)",
"Controls whether to show the \"Website title\" text or a logo located: \"/public/logo.png\" (by default)": "Controls whether to show the \"Website title\" text or a logo located: \"/public/logo.png\" (by default)",
"Website context/base URL": "Website context/base URL",
"Allows for the website to be run from a non root path. Eg: http://127.0.0.1:4444/openkb/": "Allows for the website to be run from a non root path. Eg: http://127.0.0.1:4444/openkb/",
"Allow API access": "Allow API access",
"Whether to allow API access to insert articles - See documentation for further information": "Whether to allow API access to insert articles - See documentation for further information",
"API access token": "API access token",
"Requires 'Allow API access' to be set to 'true'. The value is the access token required to access the public API. Please set to a hard to guess value": "Requires 'Allow API access' to be set to 'true'. The value is the access token required to access the public API. Please set to a hard to guess value",
"Requires \"Allow API access\" to be set to \"true\". The value is the access token required to access the public API. Please set to a hard to guess value": "Requires \"Allow API access\" to be set to \"true\". The value is the access token required to access the public API. Please set to a hard to guess value",
"Password protect": "Password protect",
"Setting to 'true' will require a user to login before viewing any pages": "Setting to 'true' will require a user to login before viewing any pages",
"Setting to \"true\" will require a user to login before viewing any pages": "Setting to \"true\" will require a user to login before viewing any pages",
"Index article body": "Index article body",
"Whether to add the body of your articles to the search index (requires restart)": "Whether to add the body of your articles to the search index (requires restart)",
"Select a theme": "Select a theme",
"The theme to use for public facing pages. Leave blank for default": "The theme to use for public facing pages. Leave blank for default",
"Select a language": "Select a language",
"The language to use for public facing pages. Leave blank for default (English)": "The language to use for public facing pages. Leave blank for default (English)",
"Show logon link": "Show logon link",
"Whether to show/hide the logon link in the top right of screen": "Whether to show/hide the logon link in the top right of screen",
"Date format": "Date format",
"Sets the global date formatting. Uses moment.js date formatting, see more here: http://momentjs.com/docs/#/displaying": "Sets the global date formatting. Uses moment.js date formatting, see more here: http://momentjs.com/docs/#/displaying",
"Article suggestions allowed": "Article suggestions allowed",
"If enabled non authenticated users can submit article suggestions for approval": "If enabled non authenticated users can submit article suggestions for approval",
"Google analytics code": "Google analytics code",
"Adds Google Analytics to public facing pages. Include the entire code from Google including the &lt;script&gt; tags": "Adds Google Analytics to public facing pages. Include the entire code from Google including the &lt;script&gt; tags",
"Adds Google Analytics to public facing pages. Include the entire code from Google including the <script> tags": "Adds Google Analytics to public facing pages. Include the entire code from Google including the <script> tags",
"Allow voting": "Allow voting",
"Whether to allow users to vote on an article": "Whether to allow users to vote on an article",
"Show article meta data": "Show article meta data",
"Whether to show article meta data including published date, last updated date, author etc": "Whether to show article meta data including published date, last updated date, author etc",
"Show author email": "Show author email",
"Controls whether the authors email address is displayed in the meta. Requires 'Show article meta data' to be true": "Controls whether the authors email address is displayed in the meta. Requires 'Show article meta data' to be true",
"Controls whether the authors email address is displayed in the meta. Requires \"Show article meta data\" to be true": "Controls whether the authors email address is displayed in the meta. Requires \"Show article meta data\" to be true",
"Article links open new page": "Article links open new page",
"Controls whether links within articles open a new page (tab)": "Controls whether links within articles open a new page (tab)",
"Add header anchors": "Add header anchors",
Expand All @@ -74,6 +84,11 @@
"Controls whether to enable the editor spellchecker": "Controls whether to enable the editor spellchecker",
"Allow article versioning": "Allow article versioning",
"Whether to track article versions with each save of the editor": "Whether to track article versions with each save of the editor",
"Allow Mermaid": "Allow Mermaid",
"Whether to enable ": "Whether to enable ",
"Allow MathJax": "Allow MathJax",
"MathJax input mode": "MathJax input mode",
"Configure the mode MathJax operates in - ": "Configure the mode MathJax operates in - ",
"Number of top articles shown on homepage": "Number of top articles shown on homepage",
"Sets the number of results shown on the home page": "Sets the number of results shown on the home page",
"Show published date": "Show published date",
Expand All @@ -88,23 +103,8 @@
"Whether to show any articles set to featured in a sidebar when viewing an article": "Whether to show any articles set to featured in a sidebar when viewing an article",
"Featured article count": "Featured article count",
"The number of featured articles shown": "The number of featured articles shown",
"Adds Google Analytics to public facing pages. Include the entire code from Google including the <script> tags": "Adds Google Analytics to public facing pages. Include the entire code from Google including the <script> tags",
"New user": "New user",
"Users name": "Users name",
"User email": "User email",
"User password": "User password",
"Password confirm": "Password confirm",
"Create": "Create",
"A user with that email address already exists": "A user with that email address already exists",
"User": "User",
"Role": "Role",
"Admin": "Admin",
"Are you sure you want to delete?": "Are you sure you want to delete?",
"User edit": "User edit",
"Password values do not match": "Password values do not match",
"Date": "Date",
"View count": "View count",
"Article title": "Article title",
"Password": "Password",
"Status": "Status",
"Draft": "Draft",
"Insert": "Insert",
Expand All @@ -115,64 +115,31 @@
"Validate": "Validate",
"Generate": "Generate",
"Slug from title": "Slug from title",
"Search the knowledge base": "Search the knowledge base",
"Was this article helpful?": "Was this article helpful?",
"Votes": "Votes",
"Article details": "Article details",
"Published date": "Published date",
"Last updated": "Last updated",
"Share article": "Share article",
"Author": "Author",
"keyword": "keyword",
"permalink": "permalink",
"Delete": "Delete",
"Reset views": "Reset views",
"Reset votes": "Reset votes",
"Featured article": "Featured article",
"Visible state": "Visible state",
"Public": "Public",
"Private": "Private",
"SEO title": "SEO title",
"SEO description": "SEO description",
"Controls whether to show the \"Website title\" text or a logo located: \"/public/logo.png\" (by default)": "Controls whether to show the \"Website title\" text or a logo located: \"/public/logo.png\" (by default)",
"Requires \"Allow API access\" to be set to \"true\". The value is the access token required to access the public API. Please set to a hard to guess value": "Requires \"Allow API access\" to be set to \"true\". The value is the access token required to access the public API. Please set to a hard to guess value",
"Setting to \"true\" will require a user to login before viewing any pages": "Setting to \"true\" will require a user to login before viewing any pages",
"Controls whether the authors email address is displayed in the meta. Requires \"Show article meta data\" to be true": "Controls whether the authors email address is displayed in the meta. Requires \"Show article meta data\" to be true",
"Not Found": "Not Found",
"Select file": "Select file",
"Upload directory": "Upload directory",
"Upload file": "Upload file",
"Tip": "Tip",
"To insert an image right click the link, copy the link address and add it to your Markdown": "To insert an image right click the link, copy the link address and add it to your Markdown",
"New directory": "New directory",
"Multiple directories can be created using a \"/\" separator": "Multiple directories can be created using a \"/\" separator",
"Article successfully deleted": "Article successfully deleted",
"Keywords": "Keywords",
"Import": "Import",
"New article successfully created": "New article successfully created",
"Successfully saved": "Successfully saved",
"Permalink": "Permalink",
"string is not defined": "string is not defined",
"searchString is not defined": "searchString is not defined",
"Please sign in": "Please sign in",
"email address": "email address",
"Sign in": "Sign in",
"Access denied. Check password and try again.": "Access denied. Check password and try again.",
"Select a language": "Select a language",
"The language to use for public facing pages. Leave blank for default (English)": "The language to use for public facing pages. Leave blank for default (English)",
"Settings successfully updated.": "Settings successfully updated.",
"Results for": "Results for",
"No results found": "No results found",
"Access denied": "Access denied",
"User account inserted": "User account inserted",
"Directory successfully created": "Directory successfully created",
"File uploaded successfully": "File uploaded successfully",
"Allow Mermaid": "Allow Mermaid",
"Whether to enable ": "Whether to enable ",
"Allow MathJax": "Allow MathJax",
"MathJax input mode": "MathJax input mode",
"Configure the mode MathJax operates in - ": "Configure the mode MathJax operates in - ",
"Setup": "Setup",
"Email address": "Email address",
"Confirm password": "Confirm password",
"Complete setup": "Complete setup",
"Failed to lookup view \"index\" in views directory \"/var/www/openkb/views\"": "Failed to lookup view \"index\" in views directory \"/var/www/openkb/views\"",
"404 - Page not found": "404 - Page not found",
"Versions": "Versions",
"Edit reason": "Edit reason",
"Previous versions": "Previous versions",
"Topic": "Topic",
"Suggestion successfully processed": "Suggestion successfully processed",
"Style": "Style"
"Articles": "Articles",
"Filter articles": "Filter articles",
"Filter": "Filter",
"Reset": "Reset",
"All": "All",
"Settings successfully updated.": "Settings successfully updated.",
"New article successfully created": "New article successfully created"
}
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
"lodash": "^4.17.2",
"lunr": "^0.7.2",
"markdown-it": "^7.0.1",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-it-toc": "^1.0.0",
"markdown-it-underline": "^1.0.0",
"markdown-it-video": "^0.4.0",
"mime-types": "^2.1.13",
"mkdirp": "^0.5.1",
"moment": "^2.15.0",
Expand All @@ -50,6 +55,7 @@
"sitemap": "^1.8.1",
"snyk": "^1.41.1",
"speakingurl": "^10.0.0",
"tocbot": "^1.0.0",
"uglify-js": "^3.0.11",
"uglifycss": "0.0.27",
"walk": "^2.3.9"
Expand Down
8 changes: 7 additions & 1 deletion public/javascripts/openKB.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,18 @@ $(document).ready(function(){
hljs.highlightBlock(block);
});

// add the table class to all tables
// add anchors to headings
if(config.add_header_anchors === true){
$('.body_text > h1, .body_text > h2, .body_text > h3, .body_text > h4, .body_text > h5').each(function(){
$(this).attr('id', convertToSlug($(this).text()));
$(this).prepend('<a class="headerAnchor" href="#' + convertToSlug($(this).text()) + '">#</a> ');
});

//tocbot needs refreshing after anchors are included
//but we can do this only if it exists. it doesn't on many pages.
if (typeof tocbot !== "undefined") {
tocbot.refresh();
}
}

// scroll to hash point
Expand Down
8,364 changes: 8,362 additions & 2 deletions public/stylesheets/flatly.bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,4 @@ html{
cursor: inherit;
display: block;
}

Loading