Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatdoc shows only blank page #96

Open
BorisBrock opened this issue Nov 28, 2017 · 4 comments
Open

Flatdoc shows only blank page #96

BorisBrock opened this issue Nov 28, 2017 · 4 comments

Comments

@BorisBrock
Copy link

To get started with flatdoc I used the template.html file together with the Readme.md. I changed the code in template.html to the following:

<script>
    Flatdoc.run({
      fetcher: Flatdoc.file('Readme.md')
    });
  </script>


But when I open the template.html in a browser (Firefox ESR 52) all I get is a blank flatdoc page. No contents from the Readme.md are shown. Am I missing something here?

PS:
In the Firefox web console there are three erros:

XML Parsing Error: syntax error
Location: file:///C:/Users/visbbr/Desktop/Doc/Readme.md
Line Number 1, Column 1: Readme.md:1:1

XML Parsing Error: syntax error
Location: file:///C:/Users/visbbr/Desktop/Doc/template.html
Line Number 1, Column 1: template.html:1:1

[Flatdoc] fetching Markdown data failed. Object { readyState: 4, getResponseHeader: .ajax/N.getResponseHeader(), getAllResponseHeaders: .ajax/N.getAllResponseHeaders(), setRequestHeader: .ajax/N.setRequestHeader(), overrideMimeType: .ajax/N.overrideMimeType(), statusCode: .ajax/N.statusCode(), abort: .ajax/N.abort(), state: .Deferred/r.state(), always: .Deferred/r.always(), then: .Deferred/r.then(), 11 more… }

@harvzor
Copy link

harvzor commented Dec 12, 2017

I believe the site has to be run from a server - you can't just open up the html file.

You can quickly create a static site using something like Python or Node. This SO post might help: https://stackoverflow.com/questions/12905426/what-is-a-faster-alternative-to-pythons-http-server-or-simplehttpserver

@pushpdeep
Copy link

@harvzor Buddy, HTML files can be opened in any browser. no server required. unless the file extension is .php / .rb / .py etc.

by the way @Vankurt you have posted this in 2017 , in 2019 , i am facing the same issue. probably some developer from the open community needs to work in it.

@AlienKevin
Copy link

For those who encounter blank page after testing their flatdoc page for a while, you may be subject to github API's request rate limit. Your error message in the console may include something like

GET https://api.github.com/repos/USER/REPO/readme 403 (Forbidden)
flatdoc.js:461 [Flatdoc] fetching Markdown data failed.

(where USER is your github user name and REPO is your repository)
Tracing the GET link yields further details:

{
  "message": "API rate limit exceeded for 43.153.32.765. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)",
  "documentation_url": "https://developer.github.com/v3/#rate-limiting"
}

The problem is because github limits unauthorized requests to 60 times per hour. I haven't found a solution yet but it seems that changing to authorized requests may solve the problem because you can make up to 5000 authorized requests per hour.
One potential solution when your do not need to change your README is to cache it.

@sdhutchins
Copy link

Also suddenly having this issue with a website. Not sure what's going on. Curious if @rstacruz has some ideas on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants