Commit 072bf2f4 authored by Dario Pinto's avatar Dario Pinto
Browse files

Fix articles ending with blockquote, add adhoc footer generation for all articles

parent 76e6e3a0
......@@ -8,6 +8,28 @@ type article =
; url : string
}
let alt_ergo_footer =
{|
> ### **About Alt-Ergo**
>
> Alt-Ergo is an open-source automatic solver of mathematical formulas designed for program verification. Alt-Ergo is very successful for proving formulas generated in the context of deductive program verification.
> It was originally designed and tuned to be used by the [Why playform](http://why.lri.fr). Its development started in 2006 at the Laboratoire de Recherche en Informatique (LRI) of the Université Paris Sud and is maintained, developed and distributed since 2013 by the company OCamlPro.
>
> Alt-Ergo is part of the formal method team here at OCamlPro. This work is partially funded by the research projects Soprano, BWare, Vocal and LCHIP.
> If you like Alt-Ergo, consider joining the [Alt-Ergo users Club](https://alt-ergo.ocamlpro.com/#club)_%
|}
let ocaml_pro_footer =
{|
> **About OCamlPro:**
>
> OCamlPro is a R&D lab founded in 2011, with the mission to help industrial users benefit from state-of-the art programming languages like OCaml and Rust.
>
>We design, create and implement custom ad-hoc software for our clients. We also have a long experience in developing and maintaining open-source tooling for OCaml, such as Opam, [TryOCaml](http://try.ocamlpro.com), ocp-indent, ocp-index and ocp-browser, and we contribute to the core-development of OCaml, notably with our work on the Flambda optimizer branch.
>
> Another area of expertise is that of Formal Methods, with tools such as our SMT Solver Alt-Ergo (check our [Alt-Ergo Users'](https://alt-ergo.ocamlpro.com/#club)). We also provide vocational trainings in OCaml and Rust, and we can build courses on formal methods on-demand. Do not hesitate to reach out by email: [contact@ocamlpro.com](mailto:contact@ocamlpro.com).
|}
let compare_articles a1 a2 = compare (a2.date, a2.title) (a1.date, a1.title)
let error msg =
......@@ -122,43 +144,57 @@ let extract_date date =
(int_of_string year, int_of_string month, int_of_string day)
| _ -> (0, 0, 0)
(** [article_footer category tags] returns a footer according to a specific type
of article, . While quite generic at the moment, it will be possible to make
it return more specific footers based on a given article's Category and Tags *)
let article_footer category tags =
match category with
| "Formal Methods" ->
if List.exists (String.equal "alt-ergo") tags then
alt_ergo_footer
else
ocaml_pro_footer
| _ -> ocaml_pro_footer
(** [article_of_string post url] convert a given raw_text article into an
[article] type *)
let article_of_string post url =
match String.split_on_char '\n' post with
| title :: author :: date :: category :: tags :: r ->
Some
{ date = extract_date (get_meta_value date)
; title = get_meta_value title
; authors =
(let auth = get_meta_value author in
match String.split_on_char ',' auth with
| [ "" ] -> [ "Unspecified authors!" ]
| auth -> auth )
; tags =
(let tags = get_meta_value tags in
match String.split_on_char ',' tags with
| [ "" ] -> [ "Unspecified tags!" ]
| tags -> tags )
; category =
begin
let c = get_meta_value category in
if not @@ List.mem c allowed_categories then (
let err_msg =
Format.asprintf {|Category (%s) invalid, try: %a@.|} c
(Format.pp_print_list
~pp_sep:(fun fmt () -> Format.fprintf fmt ", ")
Format.pp_print_string )
allowed_categories
in
Format.pp_print_flush Format.str_formatter ();
error err_msg
);
c
end
; content = String.concat "\n" r
; url
}
let date = extract_date (get_meta_value date) in
let title = get_meta_value title in
let authors =
let auth = get_meta_value author in
match String.split_on_char ',' auth with
| [ "" ] -> [ "Unspecified authors!" ]
| auth -> auth
in
let tags =
let tags = get_meta_value tags in
match String.split_on_char ',' tags with
| [ "" ] -> [ "Unspecified tags!" ]
| tags -> tags
in
let category =
let c = get_meta_value category in
if not @@ List.mem c allowed_categories then (
let err_msg =
Format.asprintf {|Category (%s) invalid, try: %a@.|} c
(Format.pp_print_list
~pp_sep:(fun fmt () -> Format.fprintf fmt ", ")
Format.pp_print_string )
allowed_categories
in
Format.pp_print_flush Format.str_formatter ();
error err_msg
);
c
in
let content =
String.concat "\n" r ^ {|<br /><hr class="featurette-divider"/>|}
^ article_footer category tags
in
Some { date; title; authors; tags; category; content; url }
| _ -> None
(** [get_article_data raw_articles] Returns a list of [article] types *)
......
......@@ -11,6 +11,10 @@ p img {
max-width: 45em;
}
h1, h2 {
font-family: "Fontin", serif;
}
.quote blockquote {
background-color: #ECDDCE;
}
......
......@@ -129,3 +129,4 @@ options for the switch that is implicitely created on `opam build` is in the
works.
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -107,3 +107,4 @@ still need to install tools that are tightly bound to a compiler version, like
> NOTE: this article is cross-posted on
> [opam.ocaml.org](https://opam.ocaml.org/blog/) and
> [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -146,3 +146,4 @@ Hopefully this extension to expressivity in dependencies will make the life of p
Note that the official repository is still in 1.2 format (served as 2.0 at `https://opam.ocaml.org/2.0`, through automatic conversion), and will only be migrated a little while after opam 2.0 is finally released. You are welcome to experiment on custom repositories or pinned packages already, but will need a little more patience before you can contribute package definitions making use of the above to the [official repository](https://github.com/ocaml/opam-repository).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -41,3 +41,4 @@ Thanks a lot for testing out this new RC and [reporting](https://github.com/ocam
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -38,3 +38,4 @@ opam update; opam install opam-devel
We hope you enjoy this new version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -46,3 +46,4 @@ opam update; opam install opam-devel
We hope you enjoy this new major version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -60,3 +60,4 @@ opam update; opam install opam-devel
We hope you enjoy this new minor version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -36,3 +36,4 @@ opam update; opam install opam-devel
We hope you enjoy this new major version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -51,3 +51,4 @@ opam update; opam install opam-devel
We hope you enjoy this new minor version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -145,6 +145,3 @@ Alt-Ergo is constantly evolving, as well as our support of the SMT-LIB standard.
![](../assets/img/logo_altergo.png)
### **About Alt-Ergo**
_Alt-Ergo is an open-source automatic solver of mathematical formulas designed for program verification. Alt-Ergo is very successful for proving formulas generated in the context of deductive program verification. It was originally designed and tuned to be used by the [Why playform](http://why.lri.fr). Its development started in 2006 at the Laboratoire de Recherche en Informatique (LRI) of the Université Paris Sud and is maintained, developed and distributed since 2013 by the company OCamlPro. Alt-Ergo is part of the formal method team here at OCamlPro. This work is partially funded by the research projects Soprano, BWare, Vocal and LCHIP. If you like Alt-Ergo, consider joining the [Alt-Ergo user’s Club](https://alt-ergo.ocamlpro.com/#club)_
\ No newline at end of file
......@@ -45,3 +45,4 @@ opam update; opam install opam-devel
We hope you enjoy this new minor version, and remain open to [bug reports](https://github.com/ocaml/opam/issues) and [suggestions](https://github.com/ocaml/opam/issues).
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -55,3 +55,4 @@ We hope you enjoy this new minor version, and remain open to [bug reports](https
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](http://www.ocamlpro.com/category/blog/).
......@@ -5,11 +5,11 @@ category=Blockchains
tags=blockains,solidity,parser
<!-- [![Solidity Logo](assets/img/solidity-cover.png "A Solidity parser in OCaml with Menhir")](https://www.ocamlpro.com/2020/05/19/ocaml-solidity-parser-with-menhir/) -->
<div align="center">
<p align="center" >
<a href="https://www.ocamlpro.com/2020/05/19/ocaml-solidity-parser-with-menhir/">
<img width="420" height="420" alt="Solidity Logo" title="A Solidity parser in OCaml with Menhir" src="assets/img/solidity-cover.png">
</a>
</div>
</p>
<br />
......@@ -94,5 +94,6 @@ Solidity_parser.Printer.string_of_code : Solidity_parser.Solidity_types.module_
Of course, all of this is Work In Progress, but we are quite happy to share it with the OCaml community. We think there is a tremendous work to be done around blockchains for experts in formal methods. Do not hesitate to contact us if you want to use this library!
> ## About Origin Labs
> Origin Labs is a company founded in 2019 by the former blockchain team at OCamlPro. At Origin Labs, they have been developing Dune Network, a fork of the Tezos blockchain, its ecosystem, and applications over the Dune Network platform. At OCamlPro, they developed TzScan, the most popular block explorer at the time, Liquidity, a smart contract language, and were involved in the development of the core protocol and node.Do not hesitate to reach out by email: contact@origin-labs.com.
## About Origin Labs
Origin Labs is a company founded in 2019 by the former blockchain team at OCamlPro. At Origin Labs, they have been developing Dune Network, a fork of the Tezos blockchain, its ecosystem, and applications over the Dune Network platform. At OCamlPro, they developed TzScan, the most popular block explorer at the time, Liquidity, a smart contract language, and were involved in the development of the core protocol and node.Do not hesitate to reach out by email: contact@origin-labs.com.
......@@ -61,5 +61,6 @@ These are some of the resources you might find interesting when building your ow
- **The Dune Network Website:** https://dune.network
> ## About Origin Labs
> Origin Labs is a company founded in 2019 by the former blockchain team at OCamlPro. At Origin Labs, they have been developing Dune Network, a fork of the Tezos blockchain, its ecosystem, and applications over the Dune Network platform. At OCamlPro, they developed TzScan, the most popular block explorer at the time, Liquidity, a smart contract language, and were involved in the development of the core protocol and node. Feel free to reach out by email: contact@origin-labs.com.
## About Origin Labs
Origin Labs is a company founded in 2019 by the former blockchain team at OCamlPro. At Origin Labs, they have been developing Dune Network, a fork of the Tezos blockchain, its ecosystem, and applications over the Dune Network platform. At OCamlPro, they developed TzScan, the most popular block explorer at the time, Liquidity, a smart contract language, and were involved in the development of the core protocol and node. Feel free to reach out by email: contact@origin-labs.com.
......@@ -117,7 +117,7 @@ package.
This also allows you to have switches which automatically install new point
releases of OCaml. For example:
```
```shell-session
opam switch create ocaml-4.11 --formula='"ocaml-base-compiler" {>= "4.11.0" & < "4.12.0~"}' --repos=old=git+https://github.com/ocaml/opam-repository#a11299d81591
opam install utop
```
......@@ -125,7 +125,7 @@ opam install utop
Creates a switch with OCaml 4.11.0 (the `--repos=` was just to select a version
of opam-repository from before 4.11.1 was released). Now issue:
```
```shell-session
opam repo set-url old git+https://github.com/ocaml/opam-repository
opam upgrade
```
......@@ -268,16 +268,17 @@ The upgrade instructions are unchanged:
1. Either from binaries: run
```
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.1.0"
```
```shell-session
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.1.0"
```
or download manually from [the Github "Releases" page](https://github.com/ocaml/opam/releases/tag/2.1.0) to your PATH.
or download manually from [the Github "Releases" page](https://github.com/ocaml/opam/releases/tag/2.1.0) to your PATH.
2. Or from source, manually: see the instructions in the [README](https://github.com/ocaml/opam/tree/2.1.0#compiling-this-repo).
You should then run:
```
```shell-session
opam init --reinit -ni
```
......@@ -368,5 +368,3 @@ This amounts to a lot of added implementation complexity when compiling over sev
A possibility would be to use .cmx files to store this information when the file is compiled, but that kind of work would have taken too long to be achieved during the internship. Moreover, the practicality of that choice is far from obvious: it would complexify the optimization pass for a small improvement with respect to a version that would be correct on non-cyclical objects and activated through annotations.
> **About OCamlPro:**
> OCamlPro is a company founded in 2011, with the mission to help industrial users benefit from state-of-the art programming languages like OCaml and Rust. We design, create and implement custom ad-hoc software for our clients. We also have a long experience in developing and maintaining open-source tooling for OCaml, such as Opam, [TryOCaml](http://try.ocamlpro.com), ocp-indent, ocp-index, and ocp-browser, and we contribute to the core-development of OCaml, notably with our work on the Flambda optimizer branch. Another area of expertise is that of Formal Methods, with tools such as our SMT Solver Alt-Ergo (check our [Alt-Ergo Users' Club](https://alt-ergo.ocamlpro.com/#club)). We also provide vocational trainings in OCaml and Rust, and we can build courses on formal methods on-demand. Do not hesitate to reach out by email: [contact@ocamlpro.com](http://ocamlpro.com/category/blog/).
......@@ -35,19 +35,19 @@ Installation instructions (unchanged):
1. From binaries: run
```
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.0.9"
```
```shell-session
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --version 2.0.9"
```
or download manually from [the Github "Releases" page](https://github.com/ocaml/opam/releases/tag/2.0.9) to your PATH. In this case, don't forget to run `opam init --reinit -ni` to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.
or download manually from [the Github "Releases" page](https://github.com/ocaml/opam/releases/tag/2.0.9) to your PATH. In this case, don't forget to run `opam init --reinit -ni` to enable sandboxing if you had version 2.0.0~rc manually installed or to update you sandbox script.
2. From source, using opam:
```
opam update; opam install opam-devel
```
```shell-session
opam update; opam install opam-devel
```
(then copy the opam binary to your PATH as explained, and don't forget to run `opam init --reinit -ni` to enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script)
(then copy the opam binary to your PATH as explained, and don't forget to run `opam init --reinit -ni` to enable sandboxing if you had version 2.0.0~rc manually installed or to update your sandbox script)
3. From source, manually: see the instructions in the [README](https://github.com/ocaml/opam/tree/2.0.9#compiling-this-repo).
......
......@@ -384,3 +384,4 @@ For real-world examples, you can check [learn-ocaml](https://github.com/ocaml-sf
>
> - [reproducible builds](https://github.com/ocaml/opam/releases/download/2.1.0/opam-2.1.0-x86_64-macos) should be a goal when you intend to distribute pre-compiled binaries.
> - [opam-bundle](https://github.com/AltGr/opam-bundle) is a different, heavy-weight approach to distributing opam software to non-OCaml developers, that retains the "compile all from source" policy but provides one big package that bootstraps OCaml, opam and all the dependencies with a single command.-
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment