https://github.com/olekscode/documentationprototype
https://github.com/olekscode/documentationprototype
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/olekscode/documentationprototype
- Owner: olekscode
- License: mit
- Created: 2022-01-31T14:27:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-04T16:04:16.000Z (almost 4 years ago)
- Last Synced: 2025-02-11T11:41:42.691Z (11 months ago)
- Language: Smalltalk
- Size: 1000 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DocumentationPrototype
[](https://github.com/olekscode/DocumentationPrototype/actions/workflows/test.yml)
[](https://coveralls.io/github/olekscode/DocumentationPrototype?branch=master)
[](https://raw.githubusercontent.com/olekscode/DocumentationPrototype/master/LICENSE)
## How to install it?
To install `DocumentationPrototype`, go to the Playground (Ctrl+OW) on your [Pharo](https://pharo.org/) image and execute the following Metacello script (select it and press Do-it button or Ctrl+D):
```Smalltalk
Metacello new
baseline: 'DocumentationPrototype';
repository: 'github://olekscode/DocumentationPrototype/src';
load.
```
## How to depend on it?
If you want to add a dependency on `DocumentationPrototype` to your project, include the following lines into your baseline method:
```Smalltalk
spec
baseline: 'DocumentationPrototype'
with: [ spec repository: 'github://olekscode/DocumentationPrototype/src' ].
```
If you are new to baselines and Metacello, check out the [Baselines](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md) tutorial on Pharo Wiki.
## How to use it?
### Adding documentation to classes
Add a class side method to any of your classes specifying the path to a documentation file or a URL to a raw Markdown documentation. For example:
```Smalltalk
DocumentationBrowser class >> documentation
^ 'pharo-local/iceberg/olekscode/DocumentationPrototype/README.md'
```
```Smalltalk
AILinearRegression class >> documentation
^ 'https://raw.githubusercontent.com/pharo-ai/linear-models-posts/master/understanding-linear-regression.md'
```
### Adding documentation to methods
You can also add documentation to specific methods using a pragma:
```Smalltalk
AIKMeans >> fit: aCollectionOfPoints
aCollectionOfPoints ifEmpty: [ ^ self ].
timesToRun timesRepeat: [ self run: aCollectionOfPoints ].
"We keep the best centroids after running the algo n-times"
centroids := bestCentroids.
self assignClusterToPoints: aCollectionOfPoints
```
If method documentation is not specified, then class documentation will be displayed.
### Browsing documentation
Then right-click on that class or any method in it and click on `Browse documentation`.


