realpython / realpython/python-guide

Generated ePubs failing validation

未关闭
#413 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Batchfile
星标
29.8k
派生
5.9k
PR 合并指标
30 天内没有已合并 PR

描述

Hello,

Following on from my latest pull request (#412) here are all the ePub validation failures from trying to export the guide.

That pull request should fix the first three errors. The eleven after it appear to be due to those pages having the quick search widget on them and the start button for it. The next two, along with the two at the end, are broken identifiers in the TOC (probably best to leave these until last). The last error is simply a case of an image being called from another server, but ePub needs all those objects. Fixing this last one just means uploading http://www.python.org/dev/peps/pep-0001/pep-0001-1.png to a suitable location and updating intro/community.rst to use the local version.

bash-3.2$ epubcheck.sh pythonguide.epub
Epubcheck Version 3.0

Validating against EPUB version 2.0
ERROR: pythonguide.epub/search.html(17,57): attribute "id" not allowed here; expected attribute "charset", "defer", "src" or "xml:space"
ERROR: pythonguide.epub/search.html(51,32): element "form" not allowed anywhere; expected the element end-tag, text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
ERROR: pythonguide.epub/search.html(54,66): element "form" not allowed anywhere; expected the element end-tag, text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
ERROR: pythonguide.epub/dev/virtualenvs.html(61,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/dev/virtualenvs.html(69,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/dev/virtualenvs.html(113,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/dev/virtualenvs.html(124,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/dev/virtualenvs.html(130,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/freezing.html(167,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/freezing.html(175,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/packaging.html(109,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/packaging.html(116,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/packaging.html(123,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/shipping/packaging.html(131,37): attribute "start" not allowed here; expected attribute "dir", "id", "lang", "style", "title" or "xml:lang"
ERROR: pythonguide.epub/genindex.html(22,28): '': fragment identifier is not defined in 'genindex.html'
ERROR: pythonguide.epub/index.html(25,25): '': fragment identifier is not defined in 'index.html'
ERROR: pythonguide.epub/intro/community.html(98,130): 'http://www.python.org/dev/peps/pep-0001/pep-0001-1.png': remote resource reference not allowed; resource must be placed in the OCF
ERROR: pythonguide.epub/starting/install/win.html(54,67): 'id1': fragment identifier is not defined in 'starting/install/win.html'
ERROR: pythonguide.epub/writing/tests.html(240,33): 'id6': fragment identifier is not defined in 'writing/tests.html'

Check finished with warnings or errors

bash-3.2$

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 epubcheck.sh pythonguide.epub 开始,将报告中列出的生成文件追溯到其源文件。检查 search.html、dev/virtualenvs.html、shipping/freezing.html、shipping/packaging.html、genindex.html、index.html、starting/install/win.html、writing/tests.html 和 intro/community.rst。列出的 EPUB 2.0 验证错误(包括远程图像引用)全部解决后,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
build-system, documentation
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。