Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
paket.local

# User-specific files
*.suo
Expand Down
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,47 @@

# FsReveal [![NuGet Status](http://img.shields.io/nuget/v/FsReveal.svg?style=flat)](https://www.nuget.org/packages/FsReveal/)

FsReveal allows you to write beautiful slides in [Markdown](http://daringfireball.net/projects/markdown/syntax)
and brings F# to the [reveal.js][revealjs] web presentation framework.
FsReveal allows you to write beautiful slides in
[Markdown](http://daringfireball.net/projects/markdown/syntax) and brings F# to
the [reveal.js][revealjs] web presentation framework.

## Quickstart

git clone --depth=1 https://github.com/fsprojects/FsReveal.git
cd FsReveal
./build.sh

## Features

- Write your slides in [Markdown](http://daringfireball.net/projects/markdown/syntax) or .fsx files
- Write your slides in
[Markdown](http://daringfireball.net/projects/markdown/syntax) or .fsx files
- Automatically updates the browser in edit mode on every save
- Syntax highlighting for most programming languages including C#, F# and LaTeX
- Speaker notes; Shows the current slide, next slide, elapsed time and current time
- Speaker notes; Shows the current slide, next slide, elapsed time and current
time
- Built in themes
- Horizontal and vertical slides
- Built in slide transitions using CSS 3D transforms
- Slide overview
- Works on mobile browsers. Swipe your way through the presentation.

[Examples](http://fsprojects.github.io/FsReveal/index.html#Examples) and a [Getting started guide](http://fsprojects.github.io/FsReveal/getting-started.html) can be found in the docs.
[Examples](http://fsprojects.github.io/FsReveal/index.html#Examples) and a
[Getting started
guide](http://fsprojects.github.io/FsReveal/getting-started.html) can be found
in the docs.

[revealjs]: https://github.com/hakimel/reveal.js/ "reveal.js | HTML presentations made easy"

### Hacking on the project

git checkout develop
# follow README in branch
# git commit ...
# send PR to `develop` if you're improving `FsReveal` or to `master` if you're
# changing the 'default' presentation everyone starts off with.

### Maintainer(s)

- [@kimsk](https://github.com/kimsk)
- [@forki](https://github.com/forki)
- [@troykershaw](https://github.com/troykershaw)

The default maintainer account for projects under "fsprojects" is [@fsprojectsgit](https://github.com/fsprojectsgit) - F# Community Project Incubation Space (repo management)
33 changes: 18 additions & 15 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#I @"packages/FsReveal/fsreveal/"
#I @"packages/FsReveal/tools/"
#I @"packages/FAKE/tools/"
#I @"packages/Suave/lib/net40"

Expand All @@ -12,7 +12,7 @@
let gitOwner = "myGitUser"
let gitHome = "https://github.com/" + gitOwner
// The name of the project on GitHub
let gitProjectName = "MyProject"
let gitProjectName = "FsReveal"
// The name of the GitHub repo subdirectory to publish slides to
let gitSubDir = ""

Expand All @@ -39,11 +39,11 @@ Target "Clean" (fun _ ->
CleanDirs [outDir]
)

let fsiEvaluator =
let fsiEvaluator =
let evaluator = FSharp.Literate.FsiEvaluator()
evaluator.EvaluationFailed.Add(fun err ->
evaluator.EvaluationFailed.Add(fun err ->
traceImportant <| sprintf "Evaluating F# snippet failed:\n%s\nThe snippet evaluated:\n%s" err.StdErr err.Text )
evaluator
evaluator

let copyStylesheet() =
try
Expand All @@ -57,15 +57,15 @@ let copyPics() =
with
| exn -> traceImportant <| sprintf "Could not copy picture: %s" exn.Message

let generateFor (file:FileInfo) =
let generateFor (file:FileInfo) =
try
copyPics()
let rec tryGenerate trials =
try
FsReveal.GenerateFromFile(file.FullName, outDir, fsiEvaluator = fsiEvaluator)
with
with
| exn when trials > 0 -> tryGenerate (trials - 1)
| exn ->
| exn ->
traceImportant <| sprintf "Could not generate slides for: %s" file.FullName
traceImportant exn.Message

Expand All @@ -92,8 +92,11 @@ let socketHandler (webSocket : WebSocket) =
while true do
let! refreshed =
Control.Async.AwaitEvent(refreshEvent.Publish)
|> Suave.Sockets.SocketOp.ofAsync
do! webSocket.send Text (ASCII.bytes "refreshed") true
|> Suave.Sockets.SocketOp.ofAsync
let seg =
let bs = ASCII.bytes "refreshed"
ByteSegment bs
do! webSocket.send Text seg true
}

let startWebServer () =
Expand All @@ -105,12 +108,12 @@ let startWebServer () =

if portIsTaken then findPort (port + 1) else port

let port = findPort 8083
let port = findPort 8080

let serverConfig =
let serverConfig =
{ defaultConfig with
homeFolder = Some (FullName outDir)
bindings = [ HttpBinding.mkSimple HTTP "127.0.0.1" port ]
bindings = [ HttpBinding.createSimple HTTP "127.0.0.1" port ]
}
let app =
choose [
Expand All @@ -131,7 +134,7 @@ Target "GenerateSlides" (fun _ ->

Target "KeepRunning" (fun _ ->
use watcher = !! (slidesDir + "/**/*.*") |> WatchChanges handleWatcherEvents

startWebServer ()

traceImportant "Waiting for slide edits. Press any key to stop."
Expand Down Expand Up @@ -162,5 +165,5 @@ Target "ReleaseSlides" (fun _ ->

"GenerateSlides"
==> "ReleaseSlides"

RunTargetOrDefault "KeepRunning"
8 changes: 4 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ then
.paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi

.paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi

packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
Expand All @@ -21,13 +21,13 @@ else
mono .paket/paket.bootstrapper.exe
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi

mono .paket/paket.exe restore
exit_code=$?
if [ $exit_code -ne 0 ]; then
exit $exit_code
exit $exit_code
fi
mono packages/FAKE/tools/FAKE.exe $@ --fsiargs -d:MONO build.fsx
fi
3 changes: 2 additions & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source https://nuget.org/api/v2
framework NET461

nuget FsReveal
nuget FAKE
nuget Suave
nuget Suave
11 changes: 7 additions & 4 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FRAMEWORK: NET461
NUGET
remote: https://www.nuget.org/api/v2
FAKE (4.28)
FAKE (4.61.2)
FSharp.Compiler.Service (2.0.0.6)
FSharp.Core (4.0.0.1)
FSharp.Core (4.1.17)
System.ValueTuple (>= 4.3)
FSharp.Formatting (2.14.4)
FSharp.Compiler.Service (2.0.0.6)
FSharpVSPowerTools.Core (>= 2.3 < 2.4)
FSharpVSPowerTools.Core (2.3)
FSharp.Compiler.Service (>= 2.0.0.3)
FsReveal (1.3.1)
FSharp.Formatting (>= 2.11)
Suave (1.1.2)
FSharp.Core (>= 3.1.2.5)
Suave (2.1)
FSharp.Core (>= 4.0.0.1)
System.ValueTuple (4.3.1)
10 changes: 5 additions & 5 deletions slides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@
[lang=paket]
source https://nuget.org/api/v2

nuget Castle.Windsor-log4net >= 3.2
nuget NUnit
github forki/FsUnit FsUnit.fs
nuget Suave ~> 2
nuget Expecto

github logary/logary src/Logary.Facade/Facade.fs

---

### C/AL
Expand Down