gitbookio / theme-default Goto Github PK
View Code? Open in Web Editor NEWDefault theme for GitBook
License: Apache License 2.0
Default theme for GitBook
License: Apache License 2.0
Is it possible to make it such that the table is at least scrollable horizontally?
Hi,
I found Mistranslation in japanese.
"SEARCH_PLACEHOLDER": "検索すると入力"
You should fix to 入力すると検索
.
thank you.
For example if you try to print a webpage:
https://gitbookio.gitbooks.io/javascript/content/functions/higher_order.html
Both of these weren't issues with the previous default theme - https://toolchain.gitbook.com/plugins/
Based on this error I get when running GitBook 3.2.2:
Uncaught TypeError: Cannot read property 'top' of undefined
at a (theme.js:formatted:5276)
at HTMLLIElement.<anonymous> (theme.js:formatted:5315)
at Function.each (theme.js:formatted:784)
at de.fn.init.each (theme.js:formatted:694)
at HTMLDivElement.l (theme.js:formatted:5313)
at HTMLDivElement.dispatch (theme.js:formatted:2468)
at HTMLDivElement.m.handle (theme.js:formatted:2400)
I've tracked it down to be from an optimized version of the while
loop in getElementTopPosition
of src/js/theme/navigation.js
where $parent
(and therefore $el
) could be null
. Accordingly, in PR #51 I've done the following:
while
loop of getElementTopPosition
while
loop of getElementTopPosition
$el.position().top
in getElementTopPosition
fail<header>
is turned into <div data-element="head" er="">
on client site, when handling a change of url without refresh of the whole page.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header
Hello, everybody!
It would be very useful to have a sourcemap
files for *.js
and *.css
. I think it is not too hard to include such things into the NPM package.
Without sourcemaps
it is difficult to debug things like this: GitbookIO/gitbook#1525
If we use gitbook editor, gitbook editor will automatically create a md file and link this file to the chapter if this chapter has no md file. This will change our summary file and create unwanted result. Sometimes, you want a chapter without link. this gives you structure like
chapter1
---article1
---article 2
but gitbook editor will make summary like
chapter 1 (chapter 1.md)
-----article 1
-----article 2
It would be great if developers could modify existing <meta>
tags or add newer <meta>
tags after extending theme-default
without having to create their own themes.
Usually the last lines of text is the most difficult to read, because they're at the bottom of the screen. One common solution is to create a Scroll Past End
option
(see atom/atom#3619).
That way the last lines of the text still can be on the center of the screen.
Environment: Windows 10, IE 11
I can't see a sidebar. And I got a javascript error.
SCRIPT5007: Unable to get property ':sidebar' of undefined or null reference
app.js (24802,9)
error is here.
src/js/storage.js (L23)
// Read a value from localstorage
get: function(key, def) {
key = baseKey+':'+key;
if (localStorage[key] === undefined) return def;
try {
var v = JSON.parse(localStorage[key]);
return v == null ? def : v;;
} catch(err) {
return localStorage[key] || def;
}
},
i fixed code. it's can show sidebar. and no javascript error.
// Read a value from localstorage
get: function(key, def) {
key = baseKey+':'+key;
if (localStorage === undefined || localStorage[key] === undefined) return def;
try {
var v = JSON.parse(localStorage[key]);
return v == null ? def : v;;
} catch(err) {
return localStorage[key] || def;
}
},
Navigation nodes should be collapsible. In particular with multiple sub levels, the current navigation is not very clear. It should be configurable in the book.json, whether sub nodes should be
a) collapsible
b) collapsed by default (mabye sublevel where it should collapse by default)
Nodes have to expand for current / active node and expanded nodes should be stored in a session cookie ...
Wrong [SPACE TO BE REMOVED]
in html-TAG
<html lang="{{ config.language }}"[SPACE TO BE REMOVED]{% if page.dir == "rtl" %}dir="rtl"{% endif %}>
theme-default/_layouts/layout.html
Line 2 in e0038f5
For example, when using footnotes, the generated link [N] does not scroll to the bottom of the page.
On print PDF, page number should alternate for left and right sides for par and odd pages.
Hi,
Currently, when doing search, below messages will be shown:
e.g:
Is there is a to change these texts, maybe for i18n?
My workaround is to replace SEARCH_RESULTS_TITLE and SEARCH_NO_RESULTS_TITLE in page.html, but maybe these two variables should be added to _i18n json files (e.g. zh-hans.json)?
Thanks
Hello,
I wanted to fork this repo and I was wondering what is the license status of it ?
NPM says Apache 2.0 but nothing's on the git repository.
I would like to change it a bit to adapt it to a corporate theme.
Thx
Regards
The gitbook-logos repo is no longer available, so building this theme (or forks) no longer works.
This was working yesterday; any chance you can reinstate the logos?
I noticed that in the generated HTML files, the theme adds a gitbook.page.hasChanged
function which has the entire configuration of the book.
I would like to exclude the config related to bulk redirect plugin. The reason is that there are a lot of from/to URLs in the config and Google crawler is indexing them wrongly, leading to a lot of 404s.
Is there some way I can configure the theme to selectively exclude the config related to a particular plugin?
Ever since gitbook 3.0 it appears the theme is missing some of the old features which made gitbook better than using standard GH pages, such as numbering the chapters, read progress, etc.
I searched pretty extensively and cannot find anyone else commenting on this or any plans to add these old features back.
http://redux-observable.github.io/redux-observable/
Is there a way to use the old theme with gitbook 3.0?
copy layouts/website from "theme-default" to my gitbook _layout directory , then using gitbook build
building my book. the final result webpage lost search input interface .
theme-default version: ( master branch and 1.0.4 tag )
gitbook version: 3.1.1
navigation.js
prevents the browser from navigating normally if the AJAX request fails.
If a page is loaded from the file system (not through a server), the AJAX request generated on navigation fails due to CORS restrictions.
I think the problem is that line 297 is commented out:
return loading.show(
promise
.fail(function (e) {
console.log(e); // eslint-disable-line no-console
// location.href = relativeUrl; <--- THIS LINE HERE
})
);
After the AJAX load fails and the error is logged to the console, the location is never updated and so the browser is never forwarded to the new page.
Here my book.json file:
$ cat book.json
{
"title": "عنوان",
"direction": "rtl",
"dir": "rtl",
"language": "fa",
"variables": {
"title": "عنوان",
"direction": "rtl",
"dir": "rtl"
}
}
My git book version:
$ gitbook -V
CLI version: 2.3.0
GitBook version: 3.2.2
Heres the html resposne after git book serve :
<!DOCTYPE HTML>
<html lang="fa" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>معرفی · عنوان</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.2">
<link rel="stylesheet" href="gitbook/style.css">
And i dont see dir
attribute for html
tag.
What i missed ?
PDF summary must have chanter page number for easy access to the content on printed documents.
Finally found this repo, but was hoping to find the options documented. Had seen on SO a mention about the showLevel
option, but am looking for the one that shows the Chapter list for a specific page on the right. This is shown on the main GitBook documentation, but isn't shown by default.
Currently, the Summary is hidden at start (CSS property left: -300px
), and then is displayed through JavaScript.
We could do the other way around. The Summary would be visible from the start and hidden with JavaScript if needed.
This would have two advantages:
Our page already has accepted several issues to relate to this problem.
I have checked you all issues, in this case, #22
your answer said that the page will only hide the summary when the user in mobile, but we still caught by this kind of problem.
Hope you can fix this problem if there is already has such answer please reply to me, Thx.
Chapter headers could have their index for easier reference, maybe enabled by an option on book.json
.
Is it possible to remove this logging for production.
Can't seem to find those anywhere. Where should I look?
On the eBook, the title is "duplicated" : in fact, the page first render the title coming from SUMMARY.md and then, the main title coming from the file itself.
「・・・<ruby>本気<rt>ほんき</rt></ruby>で?」
「<ruby>本気<rt>マジ</rt></ruby>で」
when I wrote such markdown and build gitbook,
font-size of <rt>
become very big!(the font-size of ほんき
is same as the font-size of 本気
)
The result I expected is
.markdown-section * {
box-sizing:border-box;
-webkit-box-sizing:border-box;
font-size:inherit
}
font-size:inherit
cause this. However, I cannot detect which less file produce this line.
$ gitbook --version
CLI version: 2.3.0
GitBook version: 3.2.2
$ node -v
v7.0.0
$ npm --version
4.0.2
$ uname -a
Linux yumetodo-desktop 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
firefox: 49.0.2
Gitbook should never use inline scripts (eg. <script>...inline script...</script>
) as this requires adding "unsafe-inline" to the Content-Security-Policy which in turn makes the common XSS case (the inline one) much more easily exploitable.
This is of course not a security vulnerability in Gitbook by itself, just Gitbook makes currently hard to implement CSP properly.
I don't know exactly how Gitbook works, but maybe replacing
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({...json...});
});
</script>
with
<script id="gitbook_page_info" type="text/json">
{...json...}
</script>
and the gitbook.js
init code could automatically search for this tag (eg. document.getElementById("gitbook_page_info")
), parse the JSON and call the page.hasChanged
method.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.