Skip to content

Commit

Permalink
Rewrite: strip down to a basic skeleton
Browse files Browse the repository at this point in the history
This removes almost all of the previous code. At this stage the tests
run, but it does not know how to find any docs.
  • Loading branch information
softmoth committed Apr 19, 2021
1 parent 915d01d commit 2d02c3c
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 745 deletions.
22 changes: 5 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# General
*.swp
*~

# OS
.DS_store

# Perl6
.precomp
lib/.precomp
precompiled
.pod-cache

# p6doc
p6doc-index.json

*.data
# Rakudoc
rakudoc-cache/
/Rakudoc-[0-9]*

# Raku
.precomp/
20 changes: 10 additions & 10 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The Artistic License 2.0
The Artistic License 2.0

Copyright (c) 2000-2006, The Perl Foundation.
Copyright (c) 2000-2006, The Perl Foundation.

Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Expand Down Expand Up @@ -109,15 +109,15 @@ you do at least ONE of the following:
make the Source form of the Modified Version available to others
under

(i) the Original License or
(i) the Original License or

(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.


Distribution of Compiled Forms of the Standard Version
Expand Down
3 changes: 1 addition & 2 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"name": "Rakudoc",
"perl": "6.d",
"provides": {
"Pod::Cache": "lib/Pod/Cache.rakumod",
"Rakudoc": "lib/Rakudoc.rakumod",
"Rakudoc::CMD": "lib/Rakudoc/CMD.rakumod"
},
Expand All @@ -29,7 +28,7 @@
"tags": [
],
"test-depends": [
"IO::Capture::Simple:ver<0.0.1+>",
"IO::MiddleMan:ver<1.001003+>",
"File::Temp:ver<0.0.8+>"
],
"version": "0.1.9"
Expand Down
128 changes: 14 additions & 114 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,124 +1,24 @@
# rakudoc [![Build Status](https://travis-ci.com/Raku/rakudoc.svg?branch=master)](https://travis-ci.com/Raku/rakudoc)
[![Build Status](https://travis-ci.org/Raku/rakudoc.svg?branch=master)](https://travis-ci.org/Raku/rakudoc)

rakudoc, a tool for reading Raku documentation
NAME
====

```
Usage:
rakudoc [-n] FILE
rakudoc [-n] [-d=DIR] TYPE | FEATURE | MODULE
rakudoc [-n] [-d=DIR] TYPE.ROUTINE
rakudoc -r [-n] [-d=DIR] ROUTINE
rakudoc -b build the routine index
rakudoc -h display this help and exit
rakudoc - A tool for reading Raku documentation

Where:
FILE File containing POD documentation
TYPE Type or class
MODULE Module in Raku's module search path
FEATURE Raku langauge feature
ROUTINE Routine or method associated with a type
SYNOPSIS
========

Options:
[-d | --dir] Specify a doc directory
[-n | --nopager] Deactivate pager usage for output
rakudoc

Examples:
rakudoc ~/my-pod-file.rakumod FILE
rakudoc IO::Spec TYPE
rakudoc JSON::Fast MODULE
rakudoc exceptions FEATURE
rakudoc Map.new TYPE.ROUTINE
rakudoc -r starts-with ROUTINE
DESCRIPTION
===========

See also:
rakudoc intro
rakudoc pod
https://docs.raku.org/
```
The `rakudoc` command displays Raku documentation for language features and installed modules.

## Limitations
LICENSE
=======

- Does not run on Windows yet. Please report any other portability
issues you run into.
Rakudoc is Copyright (C) 2019–2021, by Joel Schüller, Tim Siegel and others.

- Windows patches are welcome!
It is free software; you can redistribute it and/or modify it under the terms of the [Artistic License 2.0](https://www.perlfoundation.org/artistic-license-20.html).

## Installation

Clone the repository, the testdata is included as a submodule:

```
git clone --recurse-submodules https://github.com/Raku/rakudoc
```

If you already `git clone`'d it, you can get the submodule afterwards like this:

```
git submodule update --init --recursive
```

Then install dependencies:

```
$ zef --depsonly install ./rakudoc
```

## Testing against the test-docs

From inside the repository folder, you can try out `rakudoc` using the testdata,
be aware that the test-docs obviously only include the minimum, and are
primarily designed to test correct POD parsing, so they don't necessarily
represent actual documentation.

Type searching:
```
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc Map
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc Map.new
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc Array
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc Cool.abs
```

Searching for single routines:

First build the index.
```
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc -b
```

Use -r to search for a single routine:

```
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc -r new
$ RAKUDOC_TEST=1 raku -Ilib bin/rakudoc -r abs
```

### Trying it out with uninstalled documentation

It may be useful during development to run against an uninstalled set of
documentation which is not in Raku's module search path. Manually specify a
directory with `-d`.

Assuming you have cloned [Raku/doc](https://github.com/Raku/doc.git) and
this repository next to each other in the same folder, you can use it like
in the following examples:

```
$ raku -Ilib bin/rakudoc -d=../doc/doc IO
$ raku -Ilib bin/rakudoc -d=../doc/doc Num
$ raku -Ilib bin/rakudoc -d=../doc/doc Num.rand
$ raku -Ilib bin/rakudoc -d=../doc/doc IO::Path::Unix
$ raku -Ilib bin/rakudoc -d=../doc/doc Proc::Async.stdout
```

For routine searching, first build the index for that directory:

```
$ raku -Ilib bin/rakudoc -d=../doc/doc -b
```

Then search for single routines in the given directory:

```
$ raku -Ilib bin/rakudoc -d=../doc/doc -r say
$ raku -Ilib bin/rakudoc -d=../doc/doc -r exit
```
2 changes: 1 addition & 1 deletion dist.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; App::Mi6 configuration

[ReadmeFromPod]
enable = false
filename=resources/doc/bin/rakudoc.rakudoc

[Badges]
provider = travis-ci.org
Expand Down
Loading

0 comments on commit 2d02c3c

Please sign in to comment.