From b710de95c4a6a7d3773d62c63384373de9d78e29 Mon Sep 17 00:00:00 2001 From: Morten Piibeleht Date: Sun, 14 May 2017 14:44:53 +1200 Subject: [PATCH] Enable highlighting in the manual A couple of code examples were not highlighted for some reason. --- doc/src/devdocs/subarrays.md | 4 ++-- doc/src/manual/performance-tips.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/devdocs/subarrays.md b/doc/src/devdocs/subarrays.md index e7637dc47b214..cd9ca81b3ea65 100644 --- a/doc/src/devdocs/subarrays.md +++ b/doc/src/devdocs/subarrays.md @@ -54,7 +54,7 @@ any runtime overhead. The strategy adopted is first and foremost expressed in the definition of the type: -``` +```julia struct SubArray{T,N,P,I,L} <: AbstractArray{T,N} parent::P indexes::I @@ -89,7 +89,7 @@ types. For example, for `S1`, one needs to apply the `i,j` indices to the first of the parent array, whereas for `S2` one needs to apply them to the second and third. The simplest approach to indexing would be to do the type-analysis at runtime: -``` +```julia parentindexes = Array{Any}(0) for thisindex in S.indexes ... diff --git a/doc/src/manual/performance-tips.md b/doc/src/manual/performance-tips.md index e0b058aa7581e..209ab0f1c91df 100644 --- a/doc/src/manual/performance-tips.md +++ b/doc/src/manual/performance-tips.md @@ -465,7 +465,7 @@ It is often convenient to work with data structures that may contain values of a of type `Array{Any}`). But, if you're using one of these structures and happen to know the type of an element, it helps to share this knowledge with the compiler: -``` +```julia function foo(a::Array{Any,1}) x = a[1]::Int32 b = x+1 @@ -481,7 +481,7 @@ expected type, potentially catching certain bugs earlier. Keyword arguments can have declared types: -``` +```julia function with_keyword(x; name::Int = 1) ... end