Skip to content

Commit cc0025a

Browse files
author
Sebastian Krysmanski
authored
Merge pull request #26 from skrysmanski/feature/alert-support
Add support for Hugo alerts
2 parents 0bf065c + 6c59de3 commit cc0025a

File tree

45 files changed

+217
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+217
-286
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"cSpell.words": [
44
"baseof",
55
"blittable",
6+
"blockquotes",
67
"CJKT",
78
"decompiled",
89
"decompiling",

content/articles/GitHub/Actions/dump-context/index.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ The following workflow step prints the values of all variables available in the
1414
run: echo "$GITHUB_CONTEXT"
1515
```
1616
17-
```tip
18-
For easier browsing of this huge JSON structure, open job's raw log and copy the JSON to a text editor that supports JSON code folding:
19-
20-
![View raw build logs](view-raw-logs@2x.png)
21-
```
17+
> [!TIP]
18+
> For easier browsing of this huge JSON structure, open job's raw log and copy the JSON to a text editor that supports JSON code folding:
19+
>
20+
> ![View raw build logs](view-raw-logs@2x.png)

content/articles/R/plotting-graphs/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ I recently stumbled over [R](http://www.r-project.org/), a programming language
1313

1414
This post is about how to display (draw) a mathematical function with R.
1515

16-
```tip
17-
There's a very nice and interactive [tutorial for R](http:*www.codeschool.com/courses/try-r) available over at [codeschool.com](http:*www.codeschool.com/). It's free and takes about 3 - 4 hours to complete.
18-
```
16+
> [!TIP]
17+
> There's a very nice and interactive [tutorial for R](http:*www.codeschool.com/courses/try-r) available over at [codeschool.com](http:*www.codeschool.com/). It's free and takes about 3 - 4 hours to complete.
1918
2019
<!--more-->
2120

content/articles/algorithms/easy-compare-function.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,5 @@ int Compare(int a, int b) {
4444

4545
That's it.
4646

47-
```note
48-
Care should be taken if `a` and/or `b` can come close to `int.MaxValue` or `int.MinValue`. In this case the results may not be what one wants (like if `a = int.MinValue` and `b = 1` then the result will be `int.MaxValue` which is wrong).
49-
```
47+
> [!NOTE]
48+
> Care should be taken if `a` and/or `b` can come close to `int.MaxValue` or `int.MinValue`. In this case the results may not be what one wants (like if `a = int.MinValue` and `b = 1` then the result will be `int.MaxValue` which is wrong).

content/articles/algorithms/visitor-pattern.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,8 @@ public class Document {
291291
}
292292
```
293293

294-
```note
295-
The implementations of `Accept()` seem to be identical for all child classes of `DocumentPart`. However, we can't move the code into the base class because `IVisitor` doesn't have an method `Visit(DocumentPart)` but only for the concrete implementations. (We could solve this through reflection, though, but would lose compile-time checking.)
296-
```
294+
> [!NOTE]
295+
> The implementations of `Accept()` seem to be identical for all child classes of `DocumentPart`. However, we can't move the code into the base class because `IVisitor` doesn't have an method `Visit(DocumentPart)` but only for the concrete implementations. (We could solve this through reflection, though, but would lose compile-time checking.)
297296
298297
### Putting It All Together
299298

@@ -366,9 +365,8 @@ Console.WriteLine(ship.GetShipType());
366365

367366
This will print "ApolloSpacecraft". The actual method implementation to be called is chosen **at runtime** based solely on the actual type of `ship`. So, only the type of a *single* object is used to select the method, hence the name *single* dispatch.
368367

369-
```note
370-
"Single dispatch" is one form of "dynamic dispatch", i.e. the method is chosen at runtime. If the method is chosen at compile time (true for all non-virtual methods), it's called "static dispatch".
371-
```
368+
> [!NOTE]
369+
> "Single dispatch" is one form of "dynamic dispatch", i.e. the method is chosen at runtime. If the method is chosen at compile time (true for all non-virtual methods), it's called "static dispatch".
372370
373371
### Double Dispatch
374372

content/articles/cpp-cli/cheat-sheet.md

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ aliases:
1212

1313
This article provides a quick comparison between C++/CLI and C#. It's meant for those who know C# (and possibly C++) and will explain which C++/CLI language construct correspond with which in C#. (I don't know Visual Basic so I can't add infos about this here.)
1414

15-
```note
16-
This is not a complete reference but rather quick reference for those features that are (in my opinion) the most unclear.
17-
```
15+
> [!NOTE]
16+
> This is not a complete reference but rather quick reference for those features that are (in my opinion) the most unclear.
1817
1918
<!--more-->
2019

@@ -24,9 +23,8 @@ C++/CLI is - as the name suggest - an extension of C++ to allow it to use Micros
2423

2524
C++/CLI is the successor of "Managed C++", which felt unnatural to many developers. However, both "languages" have the same goal: combine native code with managed code.
2625

27-
```note
28-
C++/CLI is currently only available on Windows. At the time of writing (mid 2010) there are no plans in the Mono project to support C++/CLI. Such support would be necessary as a C++/CLI compiler creates mixed code that contains native and managed code. While the managed code could be executed by the Mono runtime the native can't. Therefore a C++/CLI library can't be used on Linux or MacOSX (or any other Mono supported OS).
29-
```
26+
> [!NOTE]
27+
> C++/CLI is currently only available on Windows. At the time of writing (mid 2010) there are no plans in the Mono project to support C++/CLI. Such support would be necessary as a C++/CLI compiler creates mixed code that contains native and managed code. While the managed code could be executed by the Mono runtime the native can't. Therefore a C++/CLI library can't be used on Linux or MacOSX (or any other Mono supported OS).
3028
3129
See also:
3230

@@ -458,9 +456,8 @@ protected:
458456

459457
You only need destructor *and* finalizer when the class hosts some unmanaged data (e.g. a pointer to a C++ class). If you don't have unmanaged data in your class, you neither need destructor nor finalizer (unless you have some members implementing `IDisposable`).
460458

461-
```warn
462-
The destructor (`Dispose()`) will **not** be called automatically from the finalizer.
463-
```
459+
> [!WARNING]
460+
> The destructor (`Dispose()`) will **not** be called automatically from the finalizer.
464461
465462
Since freeing unmanaged resources should occur in the finalizer (see [](idisposable-and-finalizers.md)), the default implementation pattern for finalizer and destructor looks like this:
466463

@@ -574,9 +571,8 @@ Calling an event is identical to calling a delegate:
574571
this->MyCustomEvent(this, EventArgs::Empty);
575572
```
576573

577-
```note
578-
Checking the event against `nullptr` isn't required in C++/CLI (unlike C#). That's because the event's `raise()` method automatically checks whether there are actually any event handlers ([source](http://stackoverflow.com/a/2014752/614177)).
579-
```
574+
> [!NOTE]
575+
> Checking the event against `nullptr` isn't required in C++/CLI (unlike C#). That's because the event's `raise()` method automatically checks whether there are actually any event handlers ([source](http://stackoverflow.com/a/2014752/614177)).
580576
581577
## Templates and Generics
582578

@@ -630,9 +626,8 @@ T MyClass::ReturnNull() {
630626
}
631627
```
632628

633-
```note
634-
The syntax of `T()` may be misleading. It does **not** create an instance of `T` on the stack and call `T`'s default constructor (as the syntax would suggest). It indeed results in `nullptr`.
635-
```
629+
> [!NOTE]
630+
> The syntax of `T()` may be misleading. It does **not** create an instance of `T` on the stack and call `T`'s default constructor (as the syntax would suggest). It indeed results in `nullptr`.
636631
637632
## Referencing managed type from other file (in the same project)
638633

content/articles/cpp-cli/passing-native-pointers/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,8 @@ void ExternalTestClass::doSomething() {
248248

249249
Of course, this also allows you to actually do something (e.g. call methods) with the `nativeClass` pointer.
250250

251-
```tip
252-
If you only want to store a pointer to a native class (i.e. don't do anything with it), you don't need to link against the native type's `.lib` file.
253-
```
251+
> [!TIP]
252+
> If you only want to store a pointer to a native class (i.e. don't do anything with it), you don't need to link against the native type's `.lib` file.
254253
255254
### Native Types From C++/CLI Projects
256255

content/articles/cpp/project-tutorial/part-1--create-project/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@ For this to work, you add the preprocessor definition `COMPILE_MYLIBRARY` to the
127127
128128
![Preprocessor configuration](preprocessor-definition.png)
129129
130-
```note
131-
The keyword `__declspec(...)` is a Microsoft specific extension to C++ (see [here](http:*msdn.microsoft.com/en-us/library/3y1sfaz2.aspx)). So it only works in Visual C++. There is an alternative (more portable?) way to specify which classes/functions are to be exported. For this, a "Module-Definition File" (`.def`) needs to be created. However, creating such a file is more tedious than specifying the export statement directly in the code. For more information, see [this article](http:*www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855).
132-
```
130+
> [!NOTE]
131+
> The keyword `__declspec(...)` is a Microsoft specific extension to C++ (see [here](http:*msdn.microsoft.com/en-us/library/3y1sfaz2.aspx)). So it only works in Visual C++. There is an alternative (more portable?) way to specify which classes/functions are to be exported. For this, a "Module-Definition File" (`.def`) needs to be created. However, creating such a file is more tedious than specifying the export statement directly in the code. For more information, see [this article](http:*www.codeguru.com/cpp/cpp/cpp_mfc/tutorials/article.php/c9855).
133132
134133
Now, when you compile the library project, an additional `.lib` file will be created. This file is used to import the exported classes/functions in another project. (If you don't export anything, the file won't be created.) How to do this, is explained in [part two of this mini series](part-2--project-dependencies.md).
135134
@@ -187,9 +186,8 @@ std::string PrintableInt<T>::toString() const
187186

188187
This adds the type parameter `T` to the class. Note that `__declspec(dllimport)` has been commented out to demonstrate the problem.
189188

190-
```note
189+
> [!NOTE]
191190
The type parameter `T` serves no purpose in this implementation. It's just there to demonstrate the problem.
192-
```
193191
194192
Now, assume another project using the library project like this:
195193

content/articles/cpp/project-tutorial/part-2--project-dependencies/index.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,13 @@ And that's it. Your project should now compile.
134134
135135
Besides being easier to use, the new way has also another advantage: The information about project dependencies are now stored in the project file instead of the solution file (which is the case with the way described in [](#specify_build_order)). This way you can use a library project that has some dependencies itself in several different solutions and always have the dependencies already set up correctly. (With the old way you had to recreate the dependencies for each solution manually.)
136136
137-
```note
138-
There are two options - available in the project settings - that influence how these references work. Both can be found under "Linker" --> "General":
139-
140-
* *Ignore Import Library:* This is specified in the library project. When this is set, the `.lib` file generated by the project won't be used automatically by projects that depend on it. (Default: No)
141-
* *Link Library Dependencies:* This is the opposite of the other option. It's specified on the project that uses other projects. If set to "No", dependencies won't be linked automatically. (Default: Yes)
142-
143-
![Linker options](automatic-linking-option.png)
144-
```
137+
> [!NOTE]
138+
> There are two options - available in the project settings - that influence how these references work. Both can be found under "Linker" --> "General":
139+
>
140+
> * *Ignore Import Library:* This is specified in the library project. When this is set, the `.lib` file generated by the project won't be used automatically by projects that depend on it. (Default: No)
141+
> * *Link Library Dependencies:* This is the opposite of the other option. It's specified on the project that uses other projects. If set to "No", dependencies won't be linked automatically. (Default: Yes)
142+
>
143+
> ![Linker options](automatic-linking-option.png)
145144
146145
### What's not working
147146

content/articles/cpp/property-sheets/index.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@ aliases:
1212

1313
Everyone who has ever created and managed a C++ project in Visual Studio knows that there are hundreds of compiler switches and options to choose from. While setting the desired values for one project may be ok, it's quite time-consuming and error-prone to do this for multiple projects. I'm currently working with a solution containing about 30 or so projects that share most of their project settings. I always wished there was a way to sync or share these common settings among the projects in the solution. Fortunately, there is: *property sheets*. They're a bit hidden though, so I'll explain how to use them in this article.
1414

15-
```note
16-
This only applies to C++ and C++/CLI projects. .NET projects (C# and Visual Basic) don't have that many options to be tweaked and (therefore?) can't have shared settings.
17-
```
15+
> [!NOTE]
16+
> This only applies to C++ and C++/CLI projects. .NET projects (C# and Visual Basic) don't have that many options to be tweaked and (therefore?) can't have shared settings.
1817
19-
```note
20-
This article describes property sheets as they appear in Visual Studio 2010. They may work slightly different in other versions of Visual Studio.
21-
```
18+
> [!NOTE]
19+
> This article describes property sheets as they appear in Visual Studio 2010. They may work slightly different in other versions of Visual Studio.
2220
2321
<!--more-->
2422

2523
## The Property Manager
2624

2725
While property sheets (file extension: `.props`) are simply XML files and therefore could be edited with a simple text editor, Visual Studio also provides an editor for property sheets. This editor is available through the so called Property Manager. To display the Property Manager pane, in the menu go to `View` --> `Other Windows` --> `Property Manager`.
2826

29-
```note
27+
> [!NOTE]
3028
Property sheet files share the same XML syntax as `.vcxproj` files.
31-
```
3229

3330
![Property Manager in main menu](property-manager-in-menu.png)
3431

@@ -48,17 +45,15 @@ Let's examine the property sheets a bit closer:
4845
* Property sheets have an order in which they're evaluated. This is important, if two property sheets define a value for the same setting. The order can be seen in the Property Manager and is bottom up. So in the image above, for the "Debug" configuration first `Core Windows Libraries` is evaluated, then `Unicode Support` and so forth. We'll examine the effects of this order a little later.
4946
* Property sheets belong to a certain configuration (such as "Debug|Win32"). The stack of property sheets defines the value that can be inherited for this specific configuration (i.e. that's what you get when you choose `<inherit from parent or project defaults>` for a value in the project settings).
5047

51-
```note
52-
The property sheet `Microsoft.Cpp.Win32.user` is located somewhere in the current user's application settings. It's contents therefore will be different for each user. By keeping it *the top item* in every configuration you allow the user to override any option, if necessary, without needing to change the project file.
53-
```
48+
> [!NOTE]
49+
> The property sheet `Microsoft.Cpp.Win32.user` is located somewhere in the current user's application settings. It's contents therefore will be different for each user. By keeping it *the top item* in every configuration you allow the user to override any option, if necessary, without needing to change the project file.
5450
5551
## Creating a shared property sheet
5652

5753
The first step is to create a new property sheet file. To do this, right-click on the project and choose `Add New Project Property Sheet`. This will add a new property sheet to all configurations of the project. In this article, we'll called the file `commons.props` and place it in a directory called `shared-properties` directly in the solution directory.
5854

59-
```note
60-
You can also right-click on a configuration and choose the same menu item. In this case the new property sheet will only be added to the selected configuration. You can, of course, add this property sheet later to the other configurations as well.
61-
```
55+
> [!NOTE]
56+
> You can also right-click on a configuration and choose the same menu item. In this case the new property sheet will only be added to the selected configuration. You can, of course, add this property sheet later to the other configurations as well.
6257
6358
As mentioned before, we want to keep the property sheet `Microsoft.Cpp.Win32.user` the top item in every configuration. So, select an instance of the new property sheets and click on the down arrow in the Property Manager's toolbar. Repeat this also for the property sheet(s) in the other configuration(s).
6459

@@ -72,9 +67,8 @@ The result then should look like this:
7267

7368
To edit a property sheet (file), simply double-click on it in the Property Manager.
7469

75-
```note
76-
The same property sheet file can be listed multiple times in the Property Manager. Editing one "instance" of this file will, of course, update all other "instances" as well (since all "instances" share the same file).
77-
```
70+
> [!NOTE]
71+
> The same property sheet file can be listed multiple times in the Property Manager. Editing one "instance" of this file will, of course, update all other "instances" as well (since all "instances" share the same file).
7872
7973
This will pop up a dialog that's very similar to the "Project Settings" dialog of a C++ project. Note that since the property sheet file itself isn't bound to any specified project kind or configuration, the dialog may display more options than are actually available to the project the property sheet is currently associated with.
8074

@@ -90,19 +84,17 @@ After clicking on `Apply`, the result should look like this:
9084

9185
Now, again, open the property sheet editor for the `common` property sheet we created earlier. There, set the `Warning Level` to `Level3 (/W3)`. Then click `OK`.
9286

93-
```note
94-
You may need to save the property sheet manually. For this, use the `Save` button in the Property Manager's toolbar.
95-
```
87+
> [!NOTE]
88+
> You may need to save the property sheet manually. For this, use the `Save` button in the Property Manager's toolbar.
9689
9790
When you now open the project's settings again, you should see that the inherited value (not in bold) of `Warning Level` *changed* from level 1 to level 3.
9891

9992
![New default value](default-value-w3.png)
10093

10194
That's the effect of the property sheet. You can define as many settings in a single property sheet file as you want. Then you can add the same property sheet file to multiple project thereby sharing this set of common project settings among all projects.
10295

103-
```note
104-
A value of a setting specified in a property sheet is only used in a project, when there isn't a custom value (printed in bold) assigned to this setting in the project settings. To take the value of the property sheet (instead of defining a value in the project file), select `<inherit from parent or project defaults>` from the drop-down menu of this setting.
105-
```
96+
> [!NOTE]
97+
> A value of a setting specified in a property sheet is only used in a project, when there isn't a custom value (printed in bold) assigned to this setting in the project settings. To take the value of the property sheet (instead of defining a value in the project file), select `<inherit from parent or project defaults>` from the drop-down menu of this setting.
10698
10799
## Property Sheet Order
108100

@@ -141,9 +133,8 @@ The XML code for inheritance is:
141133

142134
Property sheets can also contain *conditional property values*. This means that the value of a property depends on some other value. Usually, this is used to place values for debug and release builds in the same property sheet file. Unfortunately, you can edit these conditions in Visual Studio's property editor. You need to use a text editor.
143135

144-
```note
145-
When you've modified a property sheet outside of Visual Studio, you need to close the solution(s) it belongs to and reopen them afterwards. Otherwise Visual Studio won't detect the changes to the property sheet.
146-
```
136+
> [!NOTE]
137+
> When you've modified a property sheet outside of Visual Studio, you need to close the solution(s) it belongs to and reopen them afterwards. Otherwise Visual Studio won't detect the changes to the property sheet.
147138
148139
First, you can define conditions on single properties by using the `Condition` attribute:
149140

0 commit comments

Comments
 (0)