Code Monkey home page Code Monkey logo

doc's Introduction

Official Documentation of PerlĀ 6

Build Status artistic Run Status

An HTML version of this documentation can be found at https://docs.perl6.org/. This is currently the recommended way to consume the documentation.

There is also a command line tool called p6doc, which you can use to browse the documentation once it's installed (see below).

This documentation is updated frequently to a GitHub mirror https://perl6docs.github.io but that might be out of sync with the official one.

Docker container

This documentation is also published as the jjmerelo/perl6-doc Docker container. It includes a copy of the web published on port 3000, so you can run it with:

docker run --rm -it -p 3000:3000 jjmerelo/perl6-doc

or

docker run --rm -it -p 31415:3000 jjmerelo/perl6-doc

in case you want it published somewhere else. You can direct your browser to http://localhost:3000 (or 31415, as the case may be).

README in other languages

Install p6doc

This module is available via the PerlĀ 6 module ecosystem. Use:

$ zef install p6doc

to install the "binaries" and make them available in your binaries execution path.

Note: Please note that, due to changes in the parsing of Pod6, this will fail in versions of PerlĀ 6 older than 2018.06. Please upgrade to that version, or install using --force.

Use p6doc

With a Rakudo perl6 executable in the PATH, try:

$ ./bin/p6doc Str

to see the documentation for class Str, or:

$ ./bin/p6doc Str.split

to see the documentation for method split in class Str. You can skip the ./bin part if you have installed it via zef. You can also do:

$ p6doc -f slurp

to browse the documentation of standard functions (which, in this particular case, will actually return multiple matches, which you can check individually). Depending on your disk speed and Rakudo version, it might take a while.


Building the HTML documentation

You might want to have a copy of the documentation and run the web site locally yourself. In that case, install dependencies by running the following in the checkout directory:

$ zef --deps-only install .

If you use rakudobrew, also run the following, to update the shims for installed executables:

$ rakudobrew rehash

In addition to the PerlĀ 6 dependencies, you need to have graphviz installed, which on Debian you can do by running:

$ sudo apt-get install graphviz

To build the documentation web pages, simply run:

$ make html

For best results, we recommend that you use the latest released versions, specially any one after 2018.11.

Please note that you will need to have nodejs installed to produce HTML content with the above command, in particular a node executable should be in your PATH. Besides, you will need to have g++ installed in order to build some of the dependencies that are installed with nodejs. nodejs is needed only to apply highlighting to the included code; if you do not want that, simply write

$ make html-nohighlight

After the pages have been generated, you can view them on your local computer by starting the included app.pl program:

$ make run

You can then view the examples documentation by pointing your web browser at http://localhost:3000.

You will need at least Mojolicious installed and you will need nodejs to perform highlighting. There are also some additional modules you might need; install them all using:

$ cpanm --installdeps .

If you have pandoc installed, you can also generate an ePub with

$ make epub

Help Wanted!

PerlĀ 6 is not a small language, and documenting it takes a lot of effort. Any help is appreciated.

Here are some ways to help us:

  • Add missing documentation for classes, roles, methods or operators.
  • Add usage examples to existing documentation.
  • Proofread and correct the documentation.
  • Tell us about missing documentation by opening issues on Github.
  • Do a git grep TODO in this repository, and replace the TODO items by actual documentation.

Issues page has a list of current issues and documentation parts that are known to be missing and the CONTRIBUTING document explains briefly how to get started contributing documentation.


Some notes:

Q: Why aren't you embedding the docs in the CORE sources?
A: Several reasons:

  1. This documentation is intended to be universal with respect to a given version of the specification, and not necessarily tied to any specific PerlĀ 6 implementation.
  2. Implementations' handling of embedded Pod is still a bit uneven; this avoids potential runtime impacts.
  3. A separate repo in the perl6 Github account invites more potential contributors and editors.

Q: Should I include methods from superclasses or roles?
A: No. The HTML version already includes methods from superclasses and roles, and the p6doc script will be taught about those as well.


Vision

I want p6doc and docs.perl6.org to become the No. 1 resource to consult when you want to know something about a PerlĀ 6 feature, be it from the language, or built-in types and routines. I want it to be useful to every PerlĀ 6 programmer.

-- moritz


ENV VARS

  • P6_DOC_TEST_VERBOSE to a true value to display verbose messages during test suite run. Helpful when debugging failing test suite.
  • P6_DOC_TEST_FUDGE fudges skip-test code examples as TODO in xt/examples-compilation.t test.

LICENSE

The code in this repository is available under the Artistic License 2.0 as published by The Perl Foundation. See the LICENSE file for the full text.

This repository also contains code authored by third parties that may be licensed under a different license. Such files indicate the copyright and license terms at the top of the file. Currently these include:

doc's People

Contributors

jj avatar zoffixznet avatar coke avatar gfldex avatar moritz avatar tbrowder avatar lizmat avatar paultcochrane avatar fluca1978 avatar alexdaniel avatar stmuk avatar altai-man avatar jonathanstowe avatar mouq avatar cfa avatar tisonkun avatar samcv avatar titsuki avatar masterduke17 avatar dha avatar skids avatar antquinonez avatar finanalyst avatar smls avatar jsoref avatar rafaelschipiura avatar timo avatar morayj avatar nxadm avatar molecules avatar

Watchers

 avatar

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.