Giter Site home page Giter Site logo

vala-lang / valadoc-org Goto Github PK

View Code? Open in Web Editor NEW
83.0 6.0 25.0 4.67 MB

Build tools used to generate valadoc.org

Home Page: https://valadoc.org

License: GNU Lesser General Public License v2.1

Makefile 3.31% PHP 10.23% JavaScript 9.29% CSS 10.83% Smarty 4.76% XSLT 1.83% Vala 58.84% Dockerfile 0.84% Shell 0.06%
vala valadoc documentation website

valadoc-org's Introduction

Valadoc.org

Stays crunchy, even in milk.

This package contains build-tools used to generate valadoc.org and ideally shouldn't be used to generate other pages.

Building

In order to build the docs you will need the following:

  • valadoc >= 0.35.0
  • php
  • 4 GB of free space

On elementary OS or Ubuntu run:

sudo add-apt-repository ppa:vala-team
sudo apt update
sudo apt install valac valadoc libvaladoc-dev unzip php php-curl

Arch or derivatives run:

pacman -S vala php

Next, install JS dependencies:

npm install

After you have valadoc installed, you can move to building the documentation. Simply run:

make serve

This will take a bit of time, so grab yourself a cup of coffee; if you’re impatient, run:

make serve-mini

for a minimal test version. If you encounter an error at this step, please see the common pitfalls section. After you completed building, you should see a valadoc.org folder.

To access the documentation navigate your browser to http://localhost:7777.

Install locally

To install valadoc documentation as devhelp books, first build the pages with either

make build-docs-mini build-data GENERATOR_OPTS=--skip-existing

for just glib, gio and gobject, or

make build-docs build-data GENERATOR_OPTS=--skip-existing

for all packages. This can take a bit longer.

After that you can run

sudo make install

to install the devhelp books in your system. Now launch Devhelp and use them!

Searching

For a more complete experience, you will need to install manticore and xsltproc.

On elementary OS or Ubuntu run:

sudo apt install xsltproc

The run the following command to generate search indexes:

make serve-search

This will (eventually!) start a manticore daemon on port 51413.

Add New Packages

Open documentation/packages.xml and add a new package-entry.

Use <external-package> to create external links:

<external-package name="package-name" link="http://path/to/docs">
  short description
</external-package>

Use <package> to build and include documentation for vapi files:

<package name="gdl-1.0">
  short description
</package>

The following attributes are supported:

Name Description
name The vapi name
deprecated Set it to '"true"' to mark a package as deprecated
maintainers List of binding maintainers
gir The GIR file used to extract documentation from
c-docs Link to C documentation
ignore Do not build documentation for this entry
home Homepage link
flags Additional vala flags (Missing dependencies, ...)
gallery Link to a GTK-Doc widget gallery
vapi-image-source Source to download images from

Referenced GIR and vapi-files have to be part of one of the following repositories:

Add New Source Code Examples

Copy your examples to examples/<vapi-name>/ and add a new entry to examples/<vapi-name>/<vapi-name>.valadoc.examples:

<example>
  <title>Example Title</title>
  <image>optional-screenshot.png</image>
  <file>file-name-1.vala</file>
  <file>file-name-2.vala</file>
  <compile>valac file-name1.vala file-name-2.vala ...</compile>
  <node>Associated.Symbol.name1</node>
  <node>Associated.Symbol.name2</node>
</example>

If this is the first example for the package, add a line to the check-examples target of Makefile.

Add Handwritten Documentation

Create a new file called <vapi-name>.valadoc in documentation/<vapi-name>/:

...

/**
 * My valadoc comment
 */
c::c_symbol_name
...

/**
 * My valadoc comment
 */
Vala.Symbol.Name

Tool Overview

  • generator: Parses packages.xml files describing all packages. It is responsible for building up the page. It fetches resources such as images from specified sources, computes valadoc-calls, builds documentation for specified packages and puts-together the whole page. (make serve, make serve-mini)
  • configgen: Used to generate configuration files for our search index.
  • valadoc-example-gen: Internally used to generate example listings.
  • valadoc-example-tester: Compiles and checks all registered examples. (make test-examples)

Common Pitfalls

Uncaught Error: Class 'mysqli' not found

  • Uncomment extension=mysqli.so in your OS's php.ini (find /etc -name php.ini)

error: failed to load driver

  • Your valadoc version does not support the requested vala version. Install a recent vala version and recompile valadoc.
  • Change VALAC_VERSION in Makefile.

Other errors:

  • Check LOG in the root of this repo for more information
  • Have you run out of disk space?

Contact And Help

valadoc-org's People

Contributors

arteymix avatar astavale avatar b4n avatar benwaffle avatar btkostner avatar cjfloss avatar colinkiama avatar curioussavage avatar czkz avatar danirabbit avatar dependabot[bot] avatar desiderantes avatar elegaanz avatar elsiehupp avatar esodan avatar flobrosch avatar jameswestman avatar lewisgoddard avatar lw64 avatar mezen0 avatar mjog avatar nemequ avatar ondratu avatar pgrimaud avatar powerwaremediacore avatar rakshit087 avatar ricotz avatar rrthomas avatar tintou avatar zanderbrown 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

valadoc-org's Issues

some missing devhelp packages

Hi, there is some missing devhelp packages in valadoc.org:

  • appstream
  • gio-2.0
  • glib-2.0
  • gxml-0.14
  • gvncpluse-1.0
  • gvnc-1.0
  • gobject-2.0
  • libgdaui-5.0
  • libgitg-ext-1.0

Add an easy way to get the documentation from JSON

It would be really nice if there were a static link, say "valadoc.org/packages.json" that contains the list of currently available packages in this way:

{
  "books": [
    {
      "name": "glib-2.0",
      "description": "GLib provides the core application building blocks for libraries and applications written in C. It provides the core object system used in GNOME, the main loop implementation, and a large set of utility functions for strings and common data structures.",
      "version": "2.51.2",
      "book_url": "https://valadoc.org/glib-2.0/glib-2.0.tar.bz2"
    },
    {
      "name": "gio-2.0",
      "description": "GIO provides a modern and easy-to-use VFS API. It provides a file system abstraction which allows applications to access local and remote files with a single consistent API.",
      "version": "2.51.2",
      "book_url": "https://valadoc.org/gio-2.0/gio-2.0.tar.bz2"
    }
  ]
}

So that it's possible to list the available packages to users in order to use them offline.

Search doesn't work from index.htm

If you're at valadoc.org/ it works fine, but at /index.htm you get an error

Query failed: (1064) sphinxql: syntax error, unexpected INDEX, expecting IDENT (or 49 other tokens) near 'index=2)'

screenshot from 2016-11-08 14 39 45

No Node or npm version in package.json

Hi, I was working on fixing the tooltips tonight but I can't get the darn app to install because npm fails for me on the install of the gulp dependency which is for some reason is pointing at github so npm tries to do a git checkout and fails because for some reason after it clones the project to /tmp there are changed files (pngs) I was wondering if the version of npm/node mattered. Will probably try a different version of the module but It would be nice to let people know what version is used.

Add a version field for documentation [$20]

Something that would be useful (because of the nature of distros), is what package versions an API was last changed by. For example, someone just asked about gtk.stacksidebar and why it's not working in elementary OS. The reason is that it is new to gtk 3.16, and we ship gtk 3.14. If the docs said something like "since gtk 3.16" that would be awesome.

Bounty

Changeable sidebar size

Would it be possible to make the size of the sidebar changeable? To drag it bigger or smaller?

Parts of the content are always hided and although you have the pop up when hovering over an entry I would prefer to read them directly.

valadoc

load_images_vapi should create the directory

load_images_vapi() downloads images when vapi-image-source= is specified. If there are no images downloaded, wget will not have created the directory documentation/<package>/vapi-images/, and valadoc will break. You can try this with rm -rf valadoc.org && make build-docs. It should fail on granite

Integrate tutorials to valadoc

there are vala tutorials/examples/samples all over the web, it might be worthwhile to pull these into valadoc and put the responsibility for keeping them accurate/updated/relevant in the hands of the the documentation team.

Minimum content width

Due to us centering the content area, sometimes when there is little content, the area will be super small.

screenshot from 2017-02-15 14 43 43

Build docs for Builder & Dazzle

It would be good to add docs for Dazzle as it's use becomes more widespread in the GNOME community and possibly for Builder (libide) as well to ease plug-in development

Use ES6/7

Use Babel to transpile it, and drop JQuery by the way if possible.

And I think I'll start working on it right now. 🙂

Generator splits doc at first period

The docs for some methods splits at the first period into two separate <p> elements. See:
https://valadoc.org/gio-2.0/GLib.SocketService.start.html

So when looking at the overview page, it trims a significant portion of the annotation:
https://valadoc.org/gio-2.0/GLib.SocketService.html

I can only speculate that this is a heuristic done by the MarkupReader in valadoc for functions whose docs don't conform to the traditional "single-line summary followed by full description", but I'm not sure at all how to fix this...

Remove PHP dependency

Migrating this issue from the old repo:

Given that there's already some activity in web frameworks for Vala, like Valum, I think there's some value into using an existing Vala solution, support the underdog, etc.

Show deprecation information

Hey guys, so on this page, I can see some information like "Deprecated since 2.44: use Gio.FileMonitorFlags.WATCH_MOVES instead.", which is extremely useful. In valadoc.org, it's only displayed when you click on the enum field, but it's not displayed on the main page.

Dan says there's also supposed to be a strike-through style for deprecated items.

make sidebar padding more consistent

Icons & text feel too close together on the horizontal axis as well as too close to the left edge of the page, to me. Difference in spacing(or padding) between horizontal and vertical axis is very pronounced.
Looking at Files' sidebar, for reference: difference in spacing is way less pronounced -- barely noticeable. Biggest difference is, in Files, padding from the left edge is bigger.

Images attached, for reference.

Roughly playing around, just for checking, I got the results I was looking for by changing:
Added: "padding: 4%" to #navigation-content
Changed: "padding: 4%" in #sidebar .navi_main a
(pictured in "Valadoc Sidebar - After (Suggested).png")

What do you think?

To better see the difference, click to open the images.

Before (Current)
valadoc sidebar - before current

After (My suggestion)
valadoc sidebar - after suggested

Files:
files sidebar

Documentation for gxml-0.14 not present

The direct link, https://valadoc.org/gxml-0.10/index.htm , shows blank content. Clicking the link on the side menu shows "Error 0: . When loading /gxml-0.10/." So it looks like there was an error when building the gxml-0.10 docs.

Using the VAPI at https://github.com/nemequ/vala-girs/blob/master/vala/vapi/gxml-0.10.vapi I can build the docs fine with the command:
valadoc --directory gxml-0.10 --pkg gee-0.8 --pkg gio-2.0 --pkg libxml-2.0 gxml-0.10.vapi
This suggests there is something wrong in the valadoc-org build somewhere rather than the source.

fetch.js is not pulled when built

screenshot at 2017-07-25 08-00-57

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (fetch.js, line 0)

[Error] TypeError: document.querySelectorAll('body > div a').forEach is not a function. (In 'document.querySelectorAll('body > div a').forEach(setupLink)', 'document.querySelectorAll('body > div a').forEach' is undefined)
	(anonymous function) (valadoc.js:146)

[Error] ReferenceError: Can't find variable: fetch
	search (valadoc.js:20)
	(anonymous function) (valadoc.js:206)

Errors form Epiphany 3.20.3. Same errors in Pale Moon 27.4.0

libgitg-ext-1.0 error while building.

OS : elementary OS 0.4.1 Loki
Kernel : 4.8.0-54-generic

===== libgitg-ext-1.0 =====
valadoc --target-glib 2.99 --driver "0.34" --importdir girs --doclet "." -o "tmp/libgitg-ext-1.0" "girs/vala/vapi/libgitg-ext-1.0.vapi" --vapidir "girs/vala/vapi" --girdir "girs/gir-1.0" --pkg libgitg-1.0 --pkg ggit-1.0 --pkg Soup-2.4 --pkg WebKit2-4.0 --pkg gee-0.8 --pkg gtk+-3.0 --use-svg-images --importdir "girs/gir-1.0" --import GitgExt-1.0 --metadatadir documentation/libgitg-ext-1.0 --wiki documentation/libgitg-ext-1.0/wiki
/home/itsme/dev/valadoc-org/girs/gir-1.0/GitgExt-1.0.gir:13.2-13.43: error: unknown child element `attribute' in `namespace'
	<attribute name="ccode.gir-namespace" value="GitgExt"/>
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^               
/home/itsme/dev/valadoc-org/girs/gir-1.0/GitgExt-1.0.gir:14.2-14.55: error: unknown child element `attribute' in `namespace'
	<bitfield name="ExternalChangeHint" c:type="GitgExtExternalChangeHint" glib:type-name="GitgExtExternalChangeHint" glib:get-type="gitg_ext_external_change_hint_get_type">
	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                     

(valadoc:29148): GLib-CRITICAL **: g_str_has_suffix: assertion 'str != NULL' failed

** (valadoc:29148): CRITICAL **: valadoc_importer_gir_documentation_importer_attach_comment: assertion 'cname != NULL' failed
Failed: 2 error(s), 0 warning(s)

from LOG file.

Anyone could help me to solve this problem please?

gtkmozembed triggers assertion failure

When building the valadoc website, gtkmozembed triggers an assertion failure:

create 'gtkmozembed' ...
**
ERROR:/var/valadoc/src/generator.vala.c:2234:valadoc_index_generator_generate_wiki_index: assertion failed: (stream != null)
Aborted (core dumped)
Makefile:103: recipe for target 'build-docs' failed

Build docs for dependencies

if you run make serve-mini it builds docs for glib-2.0 and gio-2.0, but if you go to a GObject and click on 'object' it 404s. Should we be building docs for gobject-2.0 because it is a dependency of gio-2.0?

Search not working

I noticed a couple of hours ago that search is no longer working.
I'm getting this error:

Error 500: Internal Server Error. When loading /.
Click here to go to the homepage

Sphinx search index needs to be rebuilt

It doesn't appear that the Sphinx search index is being rebuilt after each new documentation update.

For example both gee-0.8 and libcolumbus have had documentation built in the last few weeks, but neither appear when entering relevant terms in search. Typing "ArrayList" does not return Gee.ArrayList. Also the tooltips for these libraries' documentation return "Query failed: (1064) no enabled local indexes to search". Whereas the tooltips for libraries that appear in search are fine. This suggests the newer documents have not been indexed. Ideally this would be done automatically.

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.