Skip to content

Commit

Permalink
refactor code + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chakravala committed Sep 22, 2017
1 parent 0154182 commit 0e49693
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
docs/build/
docs/site/
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ after_success:
- julia -e 'cd(Pkg.dir("Reduce")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("Reduce")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
# update docs
- julia -e 'Pkg.add("Documenter")'
- julia -e 'cd(Pkg.dir("Reduce")); include(joinpath("docs", "make.jl"))'
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Reduce.jl

[![Build Status](https://travis-ci.org/chakravala/Reduce.jl.svg?branch=master)](https://travis-ci.org/chakravala/Reduce.jl) [![Build status](https://ci.appveyor.com/api/projects/status/kaqu2yri4vxyr63n?svg=true)](https://ci.appveyor.com/project/chakravala/reduce-jl) [![Coverage Status](https://coveralls.io/repos/github/chakravala/Reduce.jl/badge.svg?branch=master)](https://coveralls.io/github/chakravala/Reduce.jl?branch=master) [![codecov.io](http://codecov.io/github/chakravala/Reduce.jl/coverage.svg?branch=master)](http://codecov.io/github/chakravala/Reduce.jl?branch=master)

[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://chakravala.github.io/Reduce.jl/stable)
[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://chakravala.github.io/Reduce.jl/latest)

Interface for applying symbolic manipulation on [Julia expressions](https://docs.julialang.org/en/latest/manual/metaprogramming) using [REDUCE](http://www.reduce-algebra.com)'s term rewrite system. The `Reduce` package currently provides the base functionality to work with Julia and Reduce expressions, provided that you have `redpsl` in your path. On GNU/Linux/OSX/Windows, `Pkg.build("Reduce")` will automatically download a precompiled binary of `redpsl` for you. If you are running a different Unix operating system, the build script will download the source and attempt to compile `redpsl` for you, success depends on the build tools installed. Automatic Windows build is now supported.

Expand Down Expand Up @@ -33,7 +34,7 @@ julia> Meta.show_sexpr(ans)
```
The output of `rcall` will be the same as its input type.
```Julia
julia> "int(sin(y)^2, y)" |> RExpr
julia> "int(sin(y)^2, y)" |> rcall
"( - cos(y)*sin(y) + y)/2"
```
In `IJulia` the display output of `RExpr` objects will be displayed using LaTeX with the `rlfi` REDUCE package in `latex` mode; while in the REPL, the default `nat` output mode of REDUCE will be displayed.
Expand Down
15 changes: 15 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is part of Reduce.jl. It is licensed under the MIT license
# Copyright (C) 2017 Michael Reed

using Documenter, Reduce

makedocs(
# options
modules = [Reduce],
deps = Deps.pip("mkdocs", "python-markdown-math"),
repo = "github.com/chakravala/Reduce.jl.git",
julia = "0.4",
osname = "osx",
doctest = false
)

24 changes: 24 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
site_name: Reduce.jl
repo_url: https://github.com/chakravala/Reduce.jl
site_description: Reduce.jl Documentation
site_author: chakravala

theme: readthedocs

extra_css:
- assets/Documenter.css

extra_javascript:
- https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
- assets/mathjaxhelper.js

markdown_extensions:
- extra
- tables
- fenced_code
- mdx_math

docs_dir: 'build'

pages:
- Home: index.md
27 changes: 27 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Reduce.jl Documentation

```@contents
```

## Functions

```@docs
Reduce.Reset
```

```@docs
RExpr
```

```@docs
parse
```

```@docs
rcall
```

## Index

```@index
```
36 changes: 19 additions & 17 deletions src/unary.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
# This file is part of Reduce.jl. It is licensed under the MIT license
# Copyright (C) 2017 Michael Reed

import Base: abs, conj, factorial, floor, max, min, round, sign, acos, acosh, acot, acoth, acsc, acsch, asec, asech, asin, asinh, atan, atanh, atan2, cos, cosh, cot, coth, csc, csch, exp, hypot, log, log10, sec, sech, sin, sinh, sqrt, tan, tanh # length

simfun = [
simbas = [
:abs,
:ceiling,
:conj,
:factorial,
:fix,
:floor,
:impart,
:max,
:min,
:nextprime,
:random,
:repart,
:round,
:sign,
:acos,
Expand All @@ -39,31 +31,41 @@ simfun = [
:csch,
:exp,
:hypot,
:ibeta,
:igamma,
:ln,
:log,
:log10,
:psi,
:sec,
:sech,
:sin,
:sinh,
:sqrt,
:tan,
:tanh,
:tanh
] # :length

simfun = [
:ceiling,
:fix,
:impart,
:nextprime,
:random,
:repart,
:ibeta,
:igamma,
:ln,
:psi,
:bernoulli,
:euler,
:fibonacci,
:motzkin,
:continued_fraction,
:continued_fraction
] # :length

:(export $(simfun...)) |> eval
Expr(:toplevel,[:(import Base: $i) for i simbas]...) |> eval
:(export $([simbas;simfun]...)) |> eval

ty = [:(Compat.String),:Expr]

for fun in simfun
for fun in [simbas;simfun]
rfun = Symbol(:r,fun)
for T in ty
quote
Expand Down

0 comments on commit 0e49693

Please sign in to comment.