summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* devdocs: Distinguish between versioning notesPhilip Chimento2018-08-061-3/+3
| | | | | | Previously, Since:, Deprecated:, and Stability: annotations were all given the same CSS class. In order to style them differently, we give them different classes.
* devdocs: Mention when a function throws an errorPhilip Chimento2018-08-061-0/+4
| | | | | This uses the "throws" annotation in the generated docs, adding a "Throws exception: Yes" if the annotation is present.
* devdocs: Format in and out parameters correctlyPhilip Chimento2018-08-061-7/+20
| | | | | | | | Previously the functions template did not properly use formatter.get_in_parameters() and formatter.get_out_parameters(), so we had inaccurate function arguments in the documentation. In particular, I originally didn't take functions with multiple return values into account.
* devdocs: Fix links to enum membersPhilip Chimento2018-08-061-1/+4
| | | | | | Links to enum members, e.g. GLib.MyEnum.FOO, were previously formatted as GLib.MyEnum.foo, so we add this special case for nodes that are ast.Members.
* devdocs: Describe aliases more thoroughlyPhilip Chimento2018-08-061-0/+16
| | | | For aliases we add a description of what Javascript type they map to.
* devdocs: Add extra CSS class to default.tmplPhilip Chimento2018-08-062-1/+11
| | | | | | | | We add an extra CSS class to default.tmpl to indicate what kind of AST node is represented here (e.g., ast.Constant). This should properly belong in get_node_kind() in docwriter.py, but adding extra kinds there would affect the way that all the other documentation output formats are generated.
* devdocs: Mark links to other GIRs as suchPhilip Chimento2018-08-061-2/+2
| | | | | | | | | | | DevDocs will try to normalize links relative to the current documentation if it can, and strips ../ off the front, so e.g. a link on the gio20/gio.file page to ../gobject20/gobject.object will end up resolving to http://<host>/gio20/gobject20/gobject.object, which doesn't exist. We clearly mark links to other GIRs with a gir:// URL scheme that DevDocs won't process automatically, and then fill in the links ourselves in the DevDocs scraper.
* devdocs: Match DevDocs' slug namesPhilip Chimento2018-08-061-2/+3
| | | | | | Because of some Ruby naming rules in DevDocs, other GIR modules will have their documentation in ../namespace10/ instead of ../NameSpace-1.0/, so change format_external_xref() to match this.
* devdocs: Describe bare functionsPhilip Chimento2018-08-061-0/+2
| | | | | Pages for bare functions (not in a class) were missing descriptions of their arguments and return values.
* devdocs: Format the values of constantsPhilip Chimento2018-08-062-3/+18
| | | | | | | We change the style of documentation pages for constants, so that their values are displayed in a <dt>/<dd> pair. We add a new method to the formatter family, format_value() which should print the representation of a constant's value in the target language; much like repr() in Python.
* docwriter: Handle moved_to in underscore functionPhilip Chimento2018-08-061-0/+2
| | | | | This function was failing on g_iconv() which has a blank name in the GIR file (its name instead coming from the moved-to attribute.)
* devdocs: Add deprecated CSS class where neededPhilip Chimento2018-08-066-20/+38
| | | | | | | | | | This adds a def in _doc.tmpl that expands to "deprecated" if the node is deprecated, and to nothing otherwise. We use it to give the deprecated CSS class to particular elements. The presence of the class on a symbol's main entry will inform DevDocs that the symbol is deprecated, though it won't be formatted in a particular way. The presence of the class on an index entry will cause the index entry to be struck out, so that it's visually obvious in the index when a symbol is deprecated.
* devdocs: Generate versioning notesPhilip Chimento2018-08-067-6/+37
| | | | | | | For GIR nodes with version annotations, such as "Since:", "Deprecated:", and "Stability:", we generate stability notes at the top of each node's documentation. These notes are given the CSS class "versioning-note" so that we can format them nicely in DevDocs.
* devdocs: Don't render private fieldsPhilip Chimento2018-08-062-4/+53
| | | | | | | | Skip private fields such as "priv" and "parent_instance". Unfortunately not all private structure and parent instance fields are marked private, and not all of them are named "priv" or "parent_instance". This also includes fields that are contained within anonymous unions.
* docwriter: Use <pre> for code blocksPhilip Chimento2018-08-061-5/+19
| | | | | | | | | | | Code blocks, i.e. |[ ]|, were converted into <code> elements, but <pre> would be more appropriate. In addition, add four spaces to the start of each line in a <pre> element so that Markdown will recognize it as code and not mangle it. As explained in a FIXME comment, a better solution would be to reimplement DocstringScanner using Markdown extensions so that such confusion becomes impossible.
* devdocs: Render a summary at the top of each pagePhilip Chimento2018-08-064-1/+176
| | | | | | This summary, heavily inspired by the one from pgi-docs, is useful when browsing the page rather than searching for a specific term. It's also similar to the summary at the top of gtk-doc pages.
* doctool: Output formatter for DevDocsPhilip Chimento2018-08-0619-5/+359
| | | | | | | In order to generate HTML output that DevDocs can easily scrape and display, we add a new output format to g-ir-doc-tool (--format=devdocs). It works similarly to the Mallard output format, but generates very simple HTML instead. We add a new set of Mako templates to generate this output.
* docwriter: parse markdown for code blocks.Mathieu Duponchelle2018-08-061-5/+65
| | | | | | | | | This also removes some "parsing" code for paragraphs, which is best handled by the actual scanner. + Also fixes some pep8 issues. https://bugzilla.gnome.org/show_bug.cgi?id=745298
* docwriter: Add support for plural type references.Mathieu Duponchelle2018-08-061-11/+25
|
* transformer: Strip whitespace from filter commandsPhilip Chimento2018-08-061-0/+1
| | | | | | | | On OS X, the output of sed as reported back to Python has a newline at the end. It seems like a good idea to strip whitespace from the symbol and identifier filter commands anyhow, so strip() the result. https://bugzilla.gnome.org/show_bug.cgi?id=752468
* docwriter: Option to select output formatPhilip Chimento2018-08-062-0/+4
| | | | | | | | | For generating other output formats such as DevDocs-ready HTML, we add an output format option (-f). The default output format is "mallard" which leaves the existing behaviour unchanged. We can fold the existing --write-sections-file option into the new output format option, as a new "sections" format.
* gir: Update annotations from glib git masterRico Tzschichholz2018-08-032-11/+11
|
* girnode: remove wrongly added g_assert_not_reached(). Fixes #218Christoph Reiter2018-08-031-1/+1
| | | | | Added in 9535fc48. After the switch it calls _g_ir_node_build_typelib() again handling the other types.
* Merge branch 'warn-flags' into 'master'Christoph Reiter2018-08-0230-102/+150
|\ | | | | | | | | autotools: add various compiler warning flags and enable -Werror for CI See merge request GNOME/gobject-introspection!56
| * girepository: port from g_type_class_add_private() to G_ADD_PRIVATE()Christoph Reiter2018-07-302-7/+2
| | | | | | | | This lets us enable -Wdeprecated-declarations
| * build: enable -Wredundant-declsChristoph Reiter2018-07-293-12/+2
| | | | | | | | | | The ffi decls were added in cbdd9ee09e367e4dd to work around broken ffi headers. Let's assume this is fixed now.
| * build: enable -Wswitch-defaultChristoph Reiter2018-07-298-2/+26
| | | | | | | | | | | | | | In case the surrounding code handles missing cases break, otherwise add a g_assert_not_reached(). The generated parser code triggers this as well, so disable it there only.
| * build: enable -Wtype-limitsChristoph Reiter2018-07-292-2/+2
| | | | | | | | hashv is unsigned, no need to check if >= 0
| * build: enable -Wimplicit-fallthroughChristoph Reiter2018-07-292-2/+1
| | | | | | | | and fix a missplaced break
| * build: enable -Wsign-compareChristoph Reiter2018-07-292-2/+6
| | | | | | | | | | Except for the generated lexer code which triggers it with the version of flex used in our CI.
| * build: enable -WshadowChristoph Reiter2018-07-296-26/+27
| |
| * g-ir-generate: fix missing error handling for command line parsingChristoph Reiter2018-07-291-1/+6
| | | | | | | | The error arg was used but the result never checked.
| * build: enable -Wcast-function-typeChristoph Reiter2018-07-297-11/+23
| | | | | | | | | | | | | | | | Where it's easy add dummy args to match the cast; where the target is a subset just prevent the warning with a cast to void*. Provide a real copy function for the boxed type code in regress_foo. This code is never executed afaics, but why not.
| * build: enable -Wsuggest-attribute=formatChristoph Reiter2018-07-292-1/+4
| | | | | | | | And use G_GNUC_PRINTF for the suggested function.
| * build: enable -Wdouble-promotionChristoph Reiter2018-07-292-2/+2
| |
| * build: enable -Wincompatible-pointer-typesChristoph Reiter2018-07-293-3/+2
| |
| * build: enable -Wdiscarded-qualifiersChristoph Reiter2018-07-296-9/+13
| | | | | | | | | | Except for the Python module because nothing in the CPython API is marked const and we'd have to cast everywhere.
| * autotools: start using AX_COMPILER_FLAGS, enable -Werror on CIChristoph Reiter2018-07-2912-39/+51
|/ | | | | | | | | * This adds a new dependency on autoconf-archive. * Pass WARN_CFLAGS/WARN_LDFLAGS/WARN_SCANNERFLAGS to everything we control the source of * Disables all warning flags which make the build error out for now, we'll re-enable them in followup commits. * AX_COMPILER_FLAGS is used with the release flag always on so we don't get -Werror by default.
* gimarshallingtests: Fix g_boxed_free usagePhilip Chimento2018-07-281-1/+5
| | | | | | | I made this edit to Simon's commit to resolve a merge conflict, but I messed it up. Revert to what it was before. See #113.
* Factor out pkg-config functionality to a separate module.Tomasz Miąsko2018-07-288-36/+197
| | | | | | | | | | | | | | Functional changes: * Consistently check that return code from pkg-config is zero. * Use shell word splitting rules to process pkg-config output to match behaviour obtained by running `cc program.cc $(pkg-config --cflags ...)`. Fixes issue #171 . * Use user preferred encoding to process output from pkg-config on Python 3. Python 2 behaviour defaults to using ascii encoding as before. edit creiter: still ignore pkg-config errors by default for now as we depend on it when glib is a subproject.
* ccompiler: simplify check_is_msvc()Christoph Reiter2018-07-281-4/+1
| | | | as was pointed out in !12
* Merge branch '113-fix-memory-leaks' into 'master'Philip Chimento2018-07-282-18/+19
|\ | | | | | | | | | | | | Resolve "Memory leaks in GI regress and marshalling tests property setters" Closes #113 See merge request GNOME/gobject-introspection!55
| * gimarshallingtests: Don't leak properties in destructionSimon Feltman2018-07-271-9/+6
| | | | | | | | | | | | | | | | | | Clear strv, boxed_struct, variant, boxed_glist, and object properties during destruction. This fixes trivial memory leaks found in the PyGObject tests suite. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
| * regress: Don't leak in property setter and destructorSimon Feltman2018-07-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | Clear the string property of RegressTestObj prior to setting within the property setter. Make sure the linked list, hash table, and string properties are cleared during destruction. This fixes trivial memory leaks found with the PyGObject test suite. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
| * regress: Use g_list_free_full and g_list_copy_deepSimon Feltman2018-07-271-9/+3
|/ | | | | | | | Cleanup which replaces manual loop implementation with API calls when setting the linked list property. https://bugzilla.gnome.org/show_bug.cgi?id=735013 Closes #113
* tests: add .exe extension when calling the offset test binaryChristoph Reiter2018-07-271-1/+2
| | | | autotools is picky on Windows and errors out otherwise
* python.m4: don't pass redundant --libs to python-configChristoph Reiter2018-07-271-1/+1
| | | | | | --libs is a subset of --ldflags which is already passed. This works around a msys2 bug in python-config: https://github.com/Alexpux/MINGW-packages/pull/4118
* scanner: remove some unnecessary Windows includesChristoph Reiter2018-07-271-9/+1
|
* scanner: fix the return type for GetFullPathNameAChristoph Reiter2018-07-271-1/+1
| | | | It's DWORD and gcc complained about defaulting to int.
* scanner: remove use of USE_WINDOWSChristoph Reiter2018-07-272-10/+0
| | | | It was never defined because G_OS_WIN32 was used before the glib include.