{"id":19615297,"url":"https://github.com/gbih/fsharp-literate-fs","last_synced_at":"2026-06-13T00:32:22.985Z","repository":{"id":176745282,"uuid":"191308166","full_name":"gbih/FSharp-literate-fs","owner":"gbih","description":"FSharp.Literate on .fs files","archived":false,"fork":false,"pushed_at":"2019-06-11T09:01:34.000Z","size":5504,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-26T17:48:34.071Z","etag":null,"topics":["fsharp"],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbih.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-11T06:29:58.000Z","updated_at":"2019-07-05T07:12:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"e62dc310-c735-4659-a3ba-099a369940c2","html_url":"https://github.com/gbih/FSharp-literate-fs","commit_stats":null,"previous_names":["gbih/fsharp-literate-fs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gbih/FSharp-literate-fs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FFSharp-literate-fs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FFSharp-literate-fs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FFSharp-literate-fs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FFSharp-literate-fs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbih","download_url":"https://codeload.github.com/gbih/FSharp-literate-fs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FFSharp-literate-fs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34268187,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fsharp"],"created_at":"2024-11-11T10:56:09.746Z","updated_at":"2026-06-13T00:32:22.951Z","avatar_url":"https://github.com/gbih.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# F# Formatting: Literate programming with .fs files\n\nThis is an experiment to create a literate F# .fs file.\n\nWe are using a forked version of [FSharp.Formatting](https://github.com/fsprojects/FSharp.Formatting) to compile a command line tool.\n\nThe only changes to the original source code are to FSharp.Literate/Main.fs and FSharp.Literate/Transformations.fs, where we now target .fs files (not .fsx)\n\n\nThe organization of this sample is:\n\n1. Source .fs files are organized in /src\n2. Misc assets (css, images) are in /doc-assets\n3. Shell scripts are in /doc-cmd\n4. Html output are in /doc-output\n5. fsformatting.exe and other necessary DLLs are copied to /doc-tools\n6. Bootstrap 4.3.1 is used for CSS\n\n\n## Getting started\n\nTo create the project: \n\n` dotnet run `\n\nTo generate documentation from .fs files in /src:\n\n`doc-cmd/publish.sh` or `doc-cmd/pubish.bat`\n\n\n\n## Sample .fs file\n\n```\n(*** hide ***)\nopen System\n\n(**\n# F# Pattern Matching\n\n### Record Pattern\nThe record pattern is used to decompose records to extract the values of fields. \nThe pattern does not have to reference all fields of the record; any omitted fields \njust do not participate in matching and are not extracted.\n*)\ntype MyRecord = { Name: string; ID: int }\n\nlet IsMatchByName record1 (name: string) =\n    match record1 with\n    | { MyRecord.Name = nameFound; MyRecord.ID = _; } when nameFound = name -\u003e true\n    | _ -\u003e false\n\nlet recordX = { Name = \"Parker\"; ID = 10 }\nlet isMatched1 = IsMatchByName recordX \"Parker\"\nlet isMatched2 = IsMatchByName recordX \"Hartono\"\n\nprintfn \"%A\" recordX\nprintfn \"%A\" isMatched1\nprintfn \"%A\" isMatched2\n\n\n(**\n### Patterns That Have Type Annotations\nPatterns can have type annotations. These behave like other type annotations and guide \ninference like other type annotations. Parentheses are required around type annotations \nin patterns. The following code shows a pattern that has a type annotation.\n*)\nlet detect1 x =\n    match x with\n    | 1 -\u003e printfn \"Found a 1!\"\n    | (var1 : int) -\u003e printfn \"%d\" var1\n\ndetect1 0 |\u003e printfn \"%A\"\ndetect1 1 |\u003e printfn \"%A\"\n\n\n(**\n### IMAGE/GRAPHICS TEST\n\nAbsolute Image Url:\n\n![test](https://upload.wikimedia.org/wikipedia/commons/f/f8/5_lemma.svg)\n\nRelative Image Url:\n\n![myImage](../doc-assets/images/Fsharp,_Logomark,_October_2014.svg)\n*)\n\n\n(**\nCode samples and explanation are from:\n\nhttps://github.com/dotnet/docs/blob/master/docs/fsharp/language-reference/pattern-matching.md\n*)\n```\n\n## Sample html file\n\nThe generated HTML file can be viewed [here](https://htmlpreview.github.io/?https://github.com/gbih/FSharp-literate-fs/blob/master/doc-output/Program.html)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Ffsharp-literate-fs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbih%2Ffsharp-literate-fs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Ffsharp-literate-fs/lists"}