Giter VIP home page Giter VIP logo

theme-default's Introduction

GitBook Default Theme

This is the default theme for GitBook since version 3.0.0. It can be used as a template for theming books or can be extended.

Image

theme-default's People

Contributors

aarono avatar alardw avatar dorako321 avatar jpreynat avatar juodumas avatar samypesse avatar soreine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theme-default's Issues

lost search interface

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

Documentation for options?

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.

right to left not implemented

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 ?

how to make summary no md file in gitbook editor

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

Opening local file in IE11, can't show sidebar.

Environment: Windows 10, IE 11

  1. prepare 2 files (README.md, SUMMARY.md)
  2. gitbook build
  3. then, open _book\index.html by using IE11

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;
    }
},

Summary didn't appear in the browser when start

Our page already has accepted several issues to relate to this problem.
image
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.

IE scroll change hash make wrong url

when scroll in ie with hash changed, each time the hash change, the url will add the disk part
the url will become something like
C:\C:\C:\Users\wf\Desktop_book\report\REPORT.html
qq 20161202044418

Proposal: Scroll Past End

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.

Possibility to collapse navigaion nodes

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 ...

[security] Injected gitbook.page.hasChanged script is not CSP-compatible

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.

JS prevents navigation of local files

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.

Selectively exclude plugins config to `hasChanged` function

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?

font-size:inherit break rt tag

「・・・<ruby>本気<rt>ほんき</rt></ruby>で?」  
「<ruby>本気<rt>マジ</rt></ruby>で」

when I wrote such markdown and build gitbook,

tmp

font-size of <rt> become very big!(the font-size of ほんき is same as the font-size of 本気)

The result I expected is

tmp

.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

Page numbers on summary

PDF summary must have chanter page number for easy access to the content on printed documents.

Provide sourcemap

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

how to change "results matching" in search result

Hi,

Currently, when doing search, below messages will be shown:
e.g:

  • 10 RESULTS MATCHING demo
  • NO RESULTS MATCHING demo

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

No LICENSE file ?

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

Subheading text color too light? (readability)

For a moment, I thought the items in the subheadings were deprecated, because they seem awfully light. It might also be a readability issue. How about making them darker?

From a purely aesthetic point of view it's nice, though.

Captura de Pantalla 2020-05-24 a la(s) 3 45 34 p  m

eBook : Title is duplicated

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.

fix Japanese SEARCH_PLACEHOLDER

Hi,

I found Mistranslation in japanese.

  • gitbook-plugin-theme-rangle-io_i18n\ja.json
    "SEARCH_PLACEHOLDER": "検索すると入力"

You should fix to 入力すると検索.

thank you.

Summary should be visible from start

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:

  • The Summary would not "flash" into the page after loading, in the common case where the user wants the Summary to be visible.
  • User with JavaScript disabled would still be able to access the, mostly static, content of the book.

Undefined error when attempting to call `getElementTopPosition`

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:

  1. A null check to the while loop of getElementTopPosition
  2. An empty jQuery element check to the while loop of getElementTopPosition
  3. Sensible defaults should the call to $el.position().top in getElementTopPosition fail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.