Skip to content

Commit 4c998de

Browse files
authored
Merge pull request #784 from JuliaLang/tl-autoblog
automatic bloglist and fixes of pifont
2 parents 2c1c3bc + c333e81 commit 4c998de

File tree

8 files changed

+184
-358
lines changed

8 files changed

+184
-358
lines changed

_css/app.css

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -625,20 +625,3 @@ table th[class*="col-"] {
625625
table tr td {
626626
hyphens: auto;
627627
}
628-
629-
.footer-copy {
630-
padding-top: 2em;
631-
margin-left: auto;
632-
margin-right: auto;
633-
}
634-
.footer-copy ul > a {
635-
font-size: 95%;
636-
}
637-
.footer-copy ul > a:first-of-type {
638-
font-size: 115%;
639-
font-weight: bold;
640-
}
641-
#footer-bottom {
642-
font-size: 90%;
643-
padding-bottom: 2em;
644-
}

_layout/foot_general.html

Lines changed: 60 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,74 @@
1+
<style>
2+
.footer-copy {
3+
padding-top: 2em;
4+
margin-left: auto;
5+
margin-right: auto;}
6+
.footer-copy ul#fmenu {
7+
display:inline-block;
8+
}
9+
.footer-copy ul#fmenu li a {
10+
font-size: 95%;
11+
color: #fff;}
12+
.footer-copy ul#fmenu li {
13+
list-style: none;}
14+
.footer-copy ul#fmenu a#fmhead {
15+
font-size: 110%;
16+
font-weight: bold;
17+
color: #7a95dd;}
18+
.footer-copy #footer-bottom {
19+
font-size:90%;}
20+
.footer-copy #footer-bottom a {
21+
color: #7a95dd;}
22+
</style>
23+
124
<footer class="container-fluid footer-copy">
225
<div class="container">
326
<div class="row">
4-
<ul id="menu" style="display:inline-block">
5-
<a href="/project"><li class="footer-heading">About</li></a>
6-
<a href="/about/help"><li>Get Help</li></a>
7-
<a href="/community/#julia_github_groups"><li>Domains</li></a>
8-
<a href="/blog/2019/02/julia-entities/"><li>Governance</li></a>
9-
<a href="/research/#publications"><li>Publications</li></a>
10-
<a href="/research/#sponsors"><li>Sponsors</li></a>
27+
<ul id="fmenu">
28+
<li><a id="fmhead" href="/project">About</a></li>
29+
<li><a href="/about/help">Get Help</a></li>
30+
<li><a href="/community/#julia_github_groups">Domains</a></li>
31+
<li><a href="/blog/2019/02/julia-entities/">Governance</a></li>
32+
<li><a href="/research/#publications">Publications</a></li>
33+
<li><a href="/research/#sponsors">Sponsors</a></li>
1134
</ul>
12-
<ul id="menu" style="display:inline-block">
13-
<a href="/downloads/"><li class="footer-heading">Downloads</li></a>
14-
<a href="/downloads/"><li>All Releases</li></a>
15-
<a href="https://github.com/JuliaLang/julia"><li>Source Code</li></a>
16-
<a href="/downloads/#current_stable_release"><li>Current Stable Release</li></a>
17-
<a href="/downloads/#long_term_support_release"><li>Longterm Support Release</li></a>
18-
<a href="/downloads/platform/#platform_specific_instructions_for_unofficial_binaries"><li>Unofficial Binaries</li></a>
35+
<ul id="fmenu">
36+
<li><a id="fmhead" href="/downloads/">Downloads</a></li>
37+
<li><a href="/downloads/">All Releases</a></li>
38+
<li><a href="https://github.com/JuliaLang/julia">Source Code</a></li>
39+
<li><a href="/downloads/#current_stable_release">Current Stable Release</a></li>
40+
<li><a href="/downloads/#long_term_support_release">Longterm Support Release</a></li>
41+
<li><a href="/downloads/platform/#platform_specific_instructions_for_unofficial_binaries">Unofficial Binaries</a></li>
1942
</ul>
20-
<ul id="menu" style="display:inline-block">
21-
<a href="https://docs.julialang.org/en/v1/"><li class="footer-heading">Documentation</li></a>
22-
<a href="https://www.youtube.com/user/JuliaLanguage"><li>Video Talks</li></a>
23-
<a href="/learning/getting-started/"><li>Beginners Guide</li></a>
24-
<a href="https://docs.julialang.org/en/v1/manual/faq/"><li>FAQ</li></a>
25-
<a href="/learning/#books"><li>Julia Books</li></a>
43+
<ul id="fmenu">
44+
<li><a id="fmhead" href="https://docs.julialang.org/en/v1/">Documentation</a></li>
45+
<li><a href="https://www.youtube.com/user/JuliaLanguage">Video Talks</a></li>
46+
<li><a href="/learning/getting-started/">Beginners Guide</a></li>
47+
<li><a href="https://docs.julialang.org/en/v1/manual/faq/">FAQ</a></li>
48+
<li><a href="/learning/#books">Julia Books</a></li>
2649
</ul>
27-
<ul id="menu" style="display:inline-block">
28-
<a href="/community/"><li class="footer-heading">Community</li></a>
29-
<a href="/community/#2019_julia_user_and_developer_survey"><li>User/Developer Survey</li></a>
30-
<a href="/diversity/"><li>Diversity</li></a>
31-
<a href="/community/#official_channels"><li>Official Channels</li></a>
32-
<a href="/community/standards/"><li>Code of Conduct</li></a>
33-
<a href="/community/#events"><li>Events</li></a>
50+
<ul id="fmenu">
51+
<li><a id="fmhead" href="/community/">Community</a></li>
52+
<li><a href="/community/#2019_julia_user_and_developer_survey">User/Developer Survey</a></li>
53+
<li><a href="/diversity/">Diversity</a></li>
54+
<li><a href="/community/#official_channels">Official Channels</a></li>
55+
<li><a href="/community/standards/">Code of Conduct</a></li>
56+
<li><a href="/community/#events">Events</a></li>
3457
</ul>
35-
<ul id="menu" style="display:inline-block">
36-
<a href="https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md"><li class="footer-heading">Contributing</li></a>
37-
<a href="https://github.com/JuliaLang/julia/issues"><li>Issue Tracker</li></a>
38-
<a href="https://github.com/JuliaLang/julia/security/policy"><li>Report a Security Issue</li></a>
39-
<a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+language%3AJulia+label%3A%22help+wanted%22"><li>Help Wanted Issues</li></a>
40-
<a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+language%3AJulia+label%3A%22good+first+issue%22+"><li>Good First Issue</li></a>
41-
<a href="https://docs.julialang.org/en/v1/devdocs/reflection/"><li>Dev Docs</li></a>
58+
<ul id="fmenu">
59+
<li><a id="fmhead" href="https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md">Contributing</a></li>
60+
<li><a href="https://github.com/JuliaLang/julia/issues">Issue Tracker</a></li>
61+
<li><a href="https://github.com/JuliaLang/julia/security/policy">Report a Security Issue</a></li>
62+
<li><a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+language%3AJulia+label%3A%22help+wanted%22">Help Wanted Issues</a></li>
63+
<li><a href="https://github.com/issues?q=is%3Aopen+is%3Aissue+language%3AJulia+label%3A%22good+first+issue%22+">Good First Issue</a></li>
64+
<li><a href="https://docs.julialang.org/en/v1/devdocs/reflection/">Dev Docs</a></li>
4265
</ul>
4366
</div>
4467
<div id="footer-bottom" class="row">
4568
<div class="col-md-10 py-2">
46-
<p>Built with <a style="color: #7a95dd" href="https://franklinjl.org">Franklin.jl</a> - a native Julia package for building websites.
47-
We thank <a style="color: #7a95dd" href="https://www.fastly.com">Fastly</a> for their generous infrastructure support.
48-
<p>©2020 JuliaLang.org <a style="color: #7a95dd" href="https://github.com/JuliaLang/www.julialang.org/graphs/contributors">contributors</a>. The content on this website is made available under the <a style="color: #7a95dd" href="https://github.com/JuliaLang/www.julialang.org/blob/master/LICENSE.md">MIT license</a>.
69+
<p>Website built with <a href="https://franklinjl.org">Franklin.jl</a> - a native Julia package for building websites.
70+
We thank <a href="https://www.fastly.com">Fastly</a> for their generous infrastructure support.
71+
<p>©2020 JuliaLang.org <a href="https://github.com/JuliaLang/www.julialang.org/graphs/contributors">contributors</a>. The content on this website is made available under the <a href="https://github.com/JuliaLang/www.julialang.org/blob/master/LICENSE.md">MIT license</a>.
4972
</div>
5073
<div class="col-md-2 py-2">
5174
<a class="github-button" href="https://github.com/sponsors/julialang" data-icon="octicon-heart" data-size="large" aria-label="Sponsor @julialang on GitHub">Sponsor</a>

blog/2018/03/pifonts.md

Lines changed: 78 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
@def rss_pubdate = Date(2018, 3, 14)
2-
@def rss = """ Some &pi;-ography | Although we've known about "Archimedes' constant" for a few millennia, we've been referring to it as the Greek letter π only since the 1700s. Patricia Rothman [suggested](https://www.historytoday.com/patricia-rothman/william-jones-and-his-circle-man-who-invented-pi) that the following page *could* c... """
3-
@def published = "14 March 2018"
4-
@def title = "Some &#928;-ography"
1+
@def title = "Some π-ography"
52
@def author = "Cormullion"
6-
@def hascode = true
7-
3+
@def published = "14 March 2018"
84

95
Although we've known about "Archimedes' constant" for a few millennia, we've been referring to it as the Greek letter π only since the 1700s. Patricia Rothman [suggested](https://www.historytoday.com/patricia-rothman/william-jones-and-his-circle-man-who-invented-pi) that the following page *could* contain one of the earliest uses of the Greek character to indicate the concept. It's from a mathematics text book written by William Jones and published in 1706:
106

@@ -22,22 +18,22 @@ But although Jones was one of the first, he wasn't influential enough to inspire
2218

2319
Julia embraces the Unicode standard [enthusiastically](https://docs.julialang.org/en/latest/manual/unicode-input/), so it's very easy to use the appropriate Greek (and other Unicode) letters in your code. In the REPL, for example, type `\pi TAB` to insert the Unicode character `U+03C0`:
2420

25-
```
21+
```julia-repl
2622
julia> π
2723
π = 3.1415926535897...
2824
```
2925

3026
and you can use it freely in expressions:
3127

32-
```
28+
```julia
3329
@test kepler_solver.([π/4, π/6, 8π/3], 0) /4, π/6, 2π/3]
3430
```
3531

3632
(although `pi` will still work, if you'd prefer). In Julia version 0.7, π and other mathematical constants such as Euler's ℯ (2.7182818284590) live in the `Base.MathConstants` module.
3733

3834
As always in Julia, you can usually see how the magic is performed:
3935

40-
```
36+
```julia-repl
4137
julia> Base.REPLCompletions.latex_symbols["\\pi"]
4238
"π"
4339
```
@@ -46,7 +42,7 @@ julia> Base.REPLCompletions.latex_symbols["\\pi"]
4642

4743
We usually use the `U+03C0` π from the Unicode block for Greek and Coptic text glyphs (Coptic was the Greek-based script adopted by the Egyptians to replace hieroglyphs), but there are other π symbols intended mainly for mathematical use. The following snippet of Julia code tries to show all the lower-case Unicode π symbols:
4844

49-
```
45+
```julia
5046
morepi = [
5147
(0x3c0, "\\pi", "GREEK SMALL LETTER PI")
5248
(0x213c, "\\bbpi", "DOUBLE-STRUCK SMALL PI") # v0.7
@@ -81,9 +77,11 @@ Some tedious experimentation suggests that the search is to some extent alphabet
8177

8278
By the way, these alternative symbols for π such as `\mitpi` don't evaluate as 3.14..., so you can use them—as William Jones did—as general purpose symbols. For example, if you work with prime numbers you could use one of them to indicate the [prime-counting function](https://en.wikipedia.org/wiki/Prime-counting_function). Or you could just confuse yourself with the following:
8379

84-
julia> 𝜋 = 3
85-
julia> 2𝜋
86-
6
80+
```julia-repl
81+
julia> 𝜋 = 3
82+
julia> 2𝜋
83+
6
84+
```
8785

8886
### The phonogram symbol Ⓟ
8987

@@ -95,52 +93,55 @@ Not all fonts contain a suitable Greek π at `U+03C0`. A few expensive fonts suc
9593

9694
Can we use Julia to find all the different designs of π? My first attempt at this challenge uses [Fontconfig.jl](https://github.com/JuliaGraphics/Fontconfig.jl) to produce a list of installed fonts, and [Luxor.jl](https://github.com/JuliaGraphics/Luxor.jl) to draw them in a table. It at least gives a glimpse of the variety of designs available, and illustrates some of the issues. Fonts that provide a zero-width glyph are skipped, meaning the table winds up being smaller than originally planned.
9795

98-
using Fontconfig, Luxor
96+
```julia
97+
using Fontconfig, Luxor
9998

100-
function buildfontlist()
101-
fonts = []
102-
for font in Fontconfig.list()
103-
families = Fontconfig.format(font, "%{family}")
104-
for family in split(families, ",")
105-
push!(fonts, family)
106-
end
99+
function buildfontlist()
100+
fonts = []
101+
for font in Fontconfig.list()
102+
families = Fontconfig.format(font, "%{family}")
103+
for family in split(families, ",")
104+
push!(fonts, family)
107105
end
108-
filter!(f -> !ismatch(r".LastResort|Agenda|Topaz|Bodoni Ornaments|System",
109-
f), fonts)
110-
return sort(unique(fonts))
111106
end
112-
113-
function tabulatepi()
114-
fonts = buildfontlist()
115-
ncols = 25
116-
nrows = convert(Int, ceil(length(fonts))) ÷ ncols
117-
@svg begin
118-
background("ivory")
119-
setopacity(1)
120-
t = Table(nrows, ncols, 30, 25)
121-
sethue("black")
122-
cellnumber = 1
123-
for n in 1:length(fonts)
124-
fontface(fonts[n])
125-
te = textextents("π")
126-
if te[3] > 0.0
127-
fontsize(18)
128-
text("π", t[cellnumber], halign=:center)
129-
setfont("Lucida-Sans", 3)
130-
settext(fonts[n], t[cellnumber] + (0, isodd(cellnumber) ? 6 : 10), halign="center")
131-
cellnumber += 1
132-
end
107+
filter!(f -> !ismatch(r".LastResort|Agenda|Topaz|Bodoni Ornaments|System",
108+
f), fonts)
109+
return sort(unique(fonts))
110+
end
111+
112+
function tabulatepi()
113+
fonts = buildfontlist()
114+
ncols = 25
115+
nrows = convert(Int, ceil(length(fonts))) ÷ ncols
116+
@svg begin
117+
background("ivory")
118+
setopacity(1)
119+
t = Table(nrows, ncols, 30, 25)
120+
sethue("black")
121+
cellnumber = 1
122+
for n in 1:length(fonts)
123+
fontface(fonts[n])
124+
te = textextents("π")
125+
if te[3] > 0.0
126+
fontsize(18)
127+
text("π", t[cellnumber], halign=:center)
128+
setfont("Lucida-Sans", 3)
129+
settext(fonts[n], t[cellnumber] + (0, isodd(cellnumber) ? 6 : 10), halign="center")
130+
cellnumber += 1
133131
end
134-
end 800 1200
135-
end
132+
end
133+
end 800 1200
134+
end
135+
136+
tabulatepi()
137+
```
136138

137-
tabulatepi()
138139

139140
You probably won't have to manually remove oddments like Bodoni Ornaments or Topaz from the font list as I had to...
140141

141-
<!-- ![tabulating pi - PNG fallback](/assets/blog/2018-04-13-pifonts/tabulate-pi.png) -->
142+
![tabulating pi - PNG fallback](/assets/blog/2018-04-13-pifonts/tabulate-pi.png)
142143

143-
![tabulating pi - SVG image](/assets/blog/2018-04-13-pifonts/tabulate-pi.svg)
144+
<!-- ![tabulating pi - SVG image](/assets/blog/2018-04-13-pifonts/tabulate-pi.svg) -->
144145

145146
It would be better if I manually curated the candidates rather than used this automatically-generated font list: there are way too many "default" designs from various system and language-specific fonts that simply fill the slot with a basic design, rather than interpret the shape according to the font's theme. And the font list produced by `fontconfig` doesn't look in all the font libraries, so it's an incomplete list.
146147

@@ -154,35 +155,37 @@ I like the small version from Dalliance; it's nicely old-school, where "old-scho
154155

155156
It occurred to me to ask "what is the average of π?", or "what would it look like if all the πs were displayed at the same time?". Using the same font list generation as before, I ran this:
156157

157-
function textstroke(s, pos, action)
158-
@layer begin
159-
translate(pos)
160-
te = textextents(s)
161-
move(-te[3]/2, te[4]/2)
162-
textpath(s)
163-
tp = pathtopoly()
164-
poly.(tp, action, close=true)
165-
end
158+
```julia
159+
function textstroke(s, pos, action)
160+
@layer begin
161+
translate(pos)
162+
te = textextents(s)
163+
move(-te[3]/2, te[4]/2)
164+
textpath(s)
165+
tp = pathtopoly()
166+
poly.(tp, action, close=true)
166167
end
167-
168-
function accumulatepi()
169-
fonts = buildfontlist()
170-
@png begin
171-
background("midnightblue")
172-
sethue("lightgoldenrod2")
173-
setline(0.2)
174-
fontsize(560)
175-
setopacity(0.3)
176-
for n in 1:length(fonts)
177-
fontface(fonts[n])
178-
te = textextents("π")
179-
if te[3] > 0.0
180-
textstroke("π", O, :stroke)
181-
end
168+
end
169+
170+
function accumulatepi()
171+
fonts = buildfontlist()
172+
@png begin
173+
background("midnightblue")
174+
sethue("lightgoldenrod2")
175+
setline(0.2)
176+
fontsize(560)
177+
setopacity(0.3)
178+
for n in 1:length(fonts)
179+
fontface(fonts[n])
180+
te = textextents("π")
181+
if te[3] > 0.0
182+
textstroke("π", O, :stroke)
182183
end
183184
end
184185
end
185-
accumulatepi()
186+
end
187+
accumulatepi()
188+
```
186189

187190
![accumulating pi](/assets/blog/2018-04-13-pifonts/accumulate-pi.png)
188191

blog/2018/07/iterators-in-julia-0.7.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@def title = "Writing Iterators in Julia 0.7"
55
@def authors = """ <a href="https://github.com/iamed2">Eric Davies</a>"""
66
@def hascode = true
7+
@def published = "8 July 2018"
78

89
### With the upcoming 0.7 release, Julia has simplified its iteration interface.
910

blog/2019/09/release-process-zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@def rss_pubdate = Date(2019, 9, 7)
22
@def rss = """从事软件开发的行家里手们对版本发布流程与节奏如此了若指掌,以至于他们将其精髓**内化**(internalize)并以为人人都懂得这些“浅显的道理”。可是事实恰好相反,外行一眼望去如同雾里看花。所以为了整个Julia社区,乃至于其它编程语言社区,我觉得有必要将Julia的开发过程白纸黑字地写下来。在本文中,我将阐述..."""
3-
@def published = "7 Sepember 2019"
3+
@def published = "7 September 2019"
44
@def title = "Julia的版本发布流程"
55
@def authors = "Stefan Karpinski (Julia Computing)"
66

blog/2020/05/rr.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
@def rss_pubdate = Date(2020, 5, 2)
55
@def rss = """Julia 1.5 is gaining a cool new bug reporting capability, leveraging mozilla's rr project to automatically create fully-reproducible bug reports"""
66
@def meta = [("property" => "og:video",
7-
"content" => "https://julialang.org/assets/blog/2020-05-02-rr/preview.mp4"),
8-
("name" => "twitter:player",
9-
"content" = "https://www.youtube.com/embed/JO6Jvad3XRU"),
10-
("name" => "twitter:player:width", content="960"),
11-
("name" => "twitter:player:height", content="720")]
7+
"content" => "https://julialang.org/assets/blog/2020-05-02-rr/preview.mp4"),
8+
("name" => "twitter:player",
9+
"content" => "https://www.youtube.com/embed/JO6Jvad3XRU"),
10+
("name" => "twitter:player:width",
11+
"content" => "960"),
12+
("name" => "twitter:player:height",
13+
"content" => "720")]
1214

1315
~~~
1416
<link rel="stylesheet" type="text/css" href="/assets/blog/2020-05-02-rr/asciinema-player.css" />

0 commit comments

Comments
 (0)