Giter Club home page Giter Club logo

bikeshed's People

Contributors

annevk avatar arronei avatar darobin avatar dbaron avatar dependabot[bot] avatar dirkschulze avatar dlaliberte avatar domenic avatar dontcallmedom avatar fantasai avatar foolip avatar frivoal avatar hober avatar jfbastien avatar jyasskin avatar kba avatar mikewest avatar nschonni avatar plinss avatar shans avatar sideshowbarker avatar simonsapin avatar svgeesus avatar tabatkins avatar tantek avatar tbble avatar tidoust avatar tobie avatar xfq avatar zcorpan 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bikeshed's Issues

See if dfnTypes should include "dfn" by default

I've hit several bugs from dfnTypes not including "dfn" by default. See what the usages of dfnTypes are, and whether it'll be more correct in general to make dfnTypes contain "dfn" or not.

Warn if headings don't have an id

Bikeshed will auto-gen an id for your headings, but this often isn't very good (it can get long and confusing), and it's not stable across changes to the heading text. I should probably add a warning whenever I autogen an id for them, to discourage the practice.

Give issues ids and permalink icons so they're linkable.

Linking to issues is annoying. Auto-add ids to issues, and a permalink icon like headings get.

Though, we preferably want the ids to be stable, so that linking to an issue doesn't go stale as soon as you add/remove an issue preceding it. Hmm. Maybe hash the contents with something simple?

HTML element references no generated

Even bikeshed update does not create the full list of HTML elements for reference. So far it just seems to be video, audio, canvas, script and meta.

Note that this might not be an issue with bike shed. Opening an issue anyway for reference.

Support Case Insensitive meta data keywords

Some time it happens that I capitalize wrong, like Previous version: instead of Previous Version: or name: instead of Name:.

Also, there is some inconsistency. It is Computed value: instead of Computed Value:.

Would it be possible to make these keywords case insensitive?

<dfn element>mask</dfn> not distinguished from property mask.

For CSS Masking I have an element and an property with the same name: mask. (Affects Filter Effects too with filter).

For the property I use the <pre class='propdef'>, the element is an auto generated table which looks quite similar to a property definition table.

I modified the SVG preprocessor to use <dfn element>mask</dfn> and let Bikeshed handle the auto linking as described in the documentation. The resulting document looks like:

<table class=propdef summary="mask element">
  <tr>
    <th>Name:</th>
    <td><dfn element>mask</dfn>
  </tr>

However, Bikeshed seems to ignore the hint and still produces:

<dfn class="css-code" data-dfn-type="property" data-export="" id="propdef-mask">mask<a class="self-link" href="#propdef-mask"></a></dfn>

and still throws:

FATAL ERROR: Multiple local 'property' <dfn>s have the same linking text 'mask'.

Maybe make specs that replace 2.1 also replace SVG?

Some properties are defined in both SVG and newer CSS specs, and the CSS definitions are the ones that should win out. Should I just make those specs replace SVG?

Alternately, just add those terms to autolink defaults as they come up.

Nonsense in property index table

I have the following meta code for the property 'transform'

<pre class='propdef'>
Name: transform
Value: none | <<transform-list>>
Initial: none
Applies to: <i>transformable elements</i>
Inherited: no
Percentages: refer to the size of <i>bounding box</i>
Computed value: As specified, but with relative lengths converted into absolute lengths.
Media: visual
Animatable: as <a href="#interpolation-of-transforms">transform</a>
</pre>

Which results in nonsense in the following nonsense in the property index table:

none | <a data-link-type="type" class="production" title="&lt;transform-list&gt;" href="#typedef-transform-list">&lt;transform-list&gt;</a>

"Latest Version" link.

W3C pubrules require a "Latest Version" link in the metadata, before previous versions links. Bikeshed should generate this automatically, or let editors insert it at the correct position. Currently, a manually-specified link ends up at the end of the table.

Missing biblio.refer entry crashes Bikeshed

I get the following mistake:

FATAL ERROR: Couldn't find 'GLSLES' in bibliography data.
FATAL ERROR: Couldn't find 'WEBGL' in bibliography data.
Traceback (most recent call last):
  File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 1613, in <module>
    main()
  File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 90, in main
    config.doc.preprocess()
  File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 1205, in preprocess
    processAutolinks(self)
  File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 900, in processAutolinks
    classifyLink(el)
  File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 861, in classifyLink
    if linkType == "maybe" and re.match(r"([\w-/]+)/([\w-]+)", linkText):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 244, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range

Both, GLSLES and WEBGL are references normatively in the spec: [[!WEBGL]] and [[!GLSLES]].

Allow targeting non-exported terms

Maybe make use of data-link-spec look for unexported things? (The main problem with non-exported things is that there are a lot of conflicts, but having a single spec helps with that.)

Or just add a data-link-force attribute (written force or link-force) which forces you it to include non-exported things.

Recognize "foo(bar)" as a dfn/link for foo()

Right now bikeshed requires you to end function/method definitions with "()", so that links to "foo()" will grab it properly. That means you can't easily have <dfn function>foo(bar)</dfn> - you have to mark it with an explicit title="foo()" to get bikeshed to accept it.

Similarly, examples like ''foo(bar)'' don't autolink to "foo()", because the linking text isn't recognized.

Bikeshed should instead verify that methods/functions have a linking text of /^[\w-]+\(.*\)$/, and fill in a title with "foo()" if necessary, for both dfns and autolinks.

Multiple possible 'propdesc' refs for 'filter'

Following output on some properties:

WARNING: Multiple possible 'propdesc' refs for 'filter'.
Arbitrarily chose the one in filters-1.
If this is wrong, insert one of the following lines into 'Link Defaults':
    filters-1 (property) filter
    filters-1 (property) filter

Note that the strings are duplicated. I assume that there is something wrong with the property definition in the anchor data. But hopefully the referencing spec does not get a warning because of a mistake in another spec.

PS: I didn't check what or if there is a mistake in Filter Effects yet. But it happens with other properties as well.

Meta data: "Issue List"

Allow "Issue List" as meta data at the beginning which takes a link to the filed bug reports.

Description referencing like 'mask source' does not work

The Markup document says:

  • <i> elements are treated as autolinks as well, for legacy reasons.
  • 'foo' (apostophes/straight quotes) is an autolink to a property or descriptor named "foo"

So assume if I have mask source then I should be able to reference it with 'mask source'. But doesn't work.

Also, what about <var> and <span>? Bert's pre-processor takes them as auto links as well if it finds a <dfn> for that. It is used in some specs. For span often with <span class="term">

Handle "foo!!bar" syntax in titles

Bert's preprocessor allowed a "foo!!bar" syntax in titles, which affected Index generation. I forget which is supposed to be the main term and which is the sub-term - I'll have to look that up.

TypeError: Cannot explicitly set an encoding with a unicode string

I got this error when running the preprocessor. Removing encoding="utf8", in calls to html5lib.parse() "solved" it, but I have no idea if that was the right thing to do. The whole code could probably use a pass of looking at what’s supposed to by bytes and what’s supposed to be Unicode ;)

Traceback (most recent call last):
  File "/home/simon/.local/bin/css-preprocess", line 9, in <module>
    load_entry_point('css-preprocessor==0.0.0', 'console_scripts', 'css-preprocess')()
  File "/home/simon/projects/css/css-preprocessor/preprocess.py", line 67, in main
    doc.preprocess()
  File "/home/simon/projects/css/css-preprocessor/preprocess.py", line 986, in preprocess
    self.document = parseDocument(self.html)
  File "/home/simon/projects/css/css-preprocessor/preprocess.py", line 124, in parseDocument
    doc = html5lib.parse(str, treebuilder='lxml', encoding='utf-8', namespaceHTMLElements=False)
  File "/home/simon/.virtualenvs/css-preprocessor/lib/python2.7/site-packages/html5lib/html5parser.py", line 28, in parse
    return p.parse(doc, encoding=encoding)
  File "/home/simon/.virtualenvs/css-preprocessor/lib/python2.7/site-packages/html5lib/html5parser.py", line 224, in parse
    parseMeta=parseMeta, useChardet=useChardet)
  File "/home/simon/.virtualenvs/css-preprocessor/lib/python2.7/site-packages/html5lib/html5parser.py", line 88, in _parse
    parser=self, **kwargs)
  File "/home/simon/.virtualenvs/css-preprocessor/lib/python2.7/site-packages/html5lib/tokenizer.py", line 40, in __init__
    self.stream = HTMLInputStream(stream, encoding, parseMeta, useChardet)
  File "/home/simon/.virtualenvs/css-preprocessor/lib/python2.7/site-packages/html5lib/inputstream.py", line 128, in HTMLInputStream
    raise TypeError("Cannot explicitly set an encoding with a unicode string")
TypeError: Cannot explicitly set an encoding with a unicode string

"bad character range" in regexp

223bc23 broke my bikeshed:

Traceback (most recent call last):
  File "/home/simon/.local/bin/bikeshed", line 9, in <module>
    load_entry_point('Bikeshed==0.0.0', 'console_scripts', 'bikeshed')()
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/site-packages/bikeshed/__init__.py", line 90, in main
    config.doc.preprocess()
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/site-packages/bikeshed/__init__.py", line 1205, in preprocess
    processAutolinks(self)
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/site-packages/bikeshed/__init__.py", line 900, in processAutolinks
    classifyLink(el)
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/site-packages/bikeshed/__init__.py", line 861, in classifyLink
    if linkType == "maybe" and re.match(r"([\w-/]+)/([\w-]+)", linkText):
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
  File "/home/simon/.virtualenvs/bikeshed/lib/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range

I’m using Python 2.7.5.

Somehow handle partial definitions correctly

Properties are occasionally extended in new specs. Rather than the two definitions conflicting, it would be great if there was some way to detect that a given propdef table was a "partial" table, augmenting an existing definition, so that a ref wouldn't produce conflicts.

This requires some data-model thought.

Linking on multiple keyword/value definitions

If you have multiple keyword or value definitions, the auto linking doesn't work so well anymore. Instead of just ''auto'' you now have to type <a value for='property'>auto</a>.

Could that be simplified to just ''property/auto''?

No 'idl' refs found for ...

I constantly get a FATAL ERROR: No 'idl' refs found for ... for IDL definitions I wrote my self. There is nothing wrong with the definition. Bikeshed should just ignore them.

How can I flag a section to be ignored?

Miscellaneous Descriptors table does not get an id

Miscellaneous Descriptors table does not get an id. I get the warning:

WARNING: You should manually provide IDs for your headings:
  <h3 class="no-num heading" id="miscellaneous-descriptors"><span class="content">Miscellaneous Descriptors</span></h3>

Review all die() locations to ensure they can be safely continued from

Fatal errors normally stop the spec generation, but --debug makes it continue. This is useful when you need to publish something now, but have some errors that Bikeshed doesn't like. Using it like this, though, requires that every die() location gracefully continues by skipping whatever it hit an error with.

I know that many/most of the die() locations do this, but I need to thoroughly review all of them to ensure that this is true of every location.

Incorrect warnings about multiple local defs when it's actually a problem with a wide type

If you run into local conflicts where there are multiple definitions of a term in different types, but your link is a wide type (like "maybe"), the error message talks about specifying the for attribute, rather than talking about the type.

The error message should inspect the list of available local refs, and see whether it's something to be solved by narrowing the type or narrowing the for.

Allow different source code file names

It seems that there is no way to take a source file with a name other than Overview.src.html. Furthermore, the output file name can not be specified. To chain bikeshed.py with other tools it would be useful to have these opportunities.

Make properties/values prettier in regular index

Right now all of the values but none of the properties are being added to the regular index, which isn't that useful. Since bikeshed should know which values belong to which property, the property could be added to the index with each of its values as a sub-item. So instead of this (from flexbox)

<number> (value), 7.3.1
<number> (value), 7.3.2

you'd get

flex-shrink, 7.3.1
   <number> (value), 7.3.1
flex-basis, 7.3.2
   <number> (value), 7.3.2

Opt-out instead of Opt-in for external access to definitions

For CSS Masking I am using a lot of definitions from CSS Background and Borders, Filter Effects and CSS Transforms that are not opt-in for external access yet and won't be for a long time until we publish new WDs (and the editors agree to add this extra markup). Could we instead opt-out definitions for external access?
I am not sure how often editors surround text with , , without actually referring to exactly this definition.

Crash 'NoneType' object has no attribute 'group'

If I run bikeshed on an unprepared spec I get the following (in this case CSS Transforms):

FATAL ERROR: No 'propdesc' refs found for 'linear'.
FATAL ERROR: No 'propdesc' refs found for 'lineargradient'.
FATAL ERROR: No 'propdesc' refs found for 'animate'.
Traceback (most recent call last):
  File "/.../bikeshed.py", line 1702, in <module>
    main()
  File "/.../bikeshed.py", line 103, in main
    config.doc.preprocess()
  File "/.../bikeshed.py", line 1306, in preprocess
    addPropertyIndex(self)
  File "/.../bikeshed.py", line 1486, in addPropertyIndex
    key = re.match(u'(.*):', textContent(row[0])).group(1).strip()
AttributeError: 'NoneType' object has no attribute 'group'

Crash when property accidentally defined twice

If one uses <pre class='propdef'> twice with the same property name for Name: twice, bikeshed crashes with:

Traceback (most recent call last):
File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 1557, in
main()
File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 103, in main
config.doc.preprocess()
File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 1161, in preprocess
processAutolinks(self)
File "/Users/dschulze/Downloads/bikeshed/bikeshed.py", line 884, in processAutolinks
error=(text not in doc.ignoredTerms))
File "/Users/dschulze/Downloads/bikeshed/lib/ReferenceManager.py", line 116, in getRef
refs[0]['type'],
UnboundLocalError: local variable 'refs' referenced before assignment

Stop treating "local" as a spec

Older code, in order to distinguish local links from cross-spec links, abused the "spec" field of the anchor data. I now properly distinguish this in the "status" field, so I should go back to filling in "spec" properly, so I can provide a good error message when you remove a link from a local spec, but it still exists in the foreign anchor data for your spec.

(That is, if a local link exists, I need to kill any non-local versions of the anchor unreservedly.)

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.