Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix xref links and disclaimer for DocFX shorthand #611

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docfx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For instructions on how to use DocFX, visit https://dotnet.github.io/docfx/
## Getting Started

1. Install DocFX

On OSX ([brew](https://brew.sh/) required)
```
brew install docfx
Expand All @@ -16,16 +16,16 @@ For instructions on how to use DocFX, visit https://dotnet.github.io/docfx/
choco install docfx -y
```

2. Clone Repo
2. Clone Repo

If you haven't cloned [Meadow.Core](https://github.com/WildernessLabs/Meadow.Core) and [Meadow.Foundation](https://github.com/WildernessLabs/Meadow.Foundation) do so first and then clone `docfx` as a sibling.
If you haven't cloned [Meadow.Core](https://github.com/WildernessLabs/Meadow.Core) and [Meadow.Foundation](https://github.com/WildernessLabs/Meadow.Foundation) do so first and then clone `docfx` as a sibling.

```
git clone [email protected]:WildernessLabs/Meadow.Core.git
```

3. Launch site:

```
cd docfx
docfx docfx.json --serve
Expand All @@ -43,14 +43,15 @@ chmod +x ./get-latest.sh

## Committing Changes

Before committing back to the repo, run `./build-docs.sh`. This will ensure you have the latest from `Meadow.Core` and `Meadow.Foundation` repos. Here's a breakdown of helper scripts:
- `./build-docs.sh` - runs `./get-latest.sh`, then runs `docfx docfx.json`
- `./build-serve-docs.sh` - runs `./get-latest.sh`, then runs `docfx docfx.json --serve`
- `./get-latest.sh` - gets latest from `Meadow.Core` and `Meadow.Foundation`
Before committing back to the repo, run `./build-docs.sh`. This will ensure you have the latest from `Meadow.Core` and `Meadow.Foundation` repos. Here's a breakdown of helper scripts:

* `./build-docs.sh` - runs `./get-latest.sh`, then runs `docfx docfx.json`
* `./build-serve-docs.sh` - runs `./get-latest.sh`, then runs `docfx docfx.json --serve`
* `./get-latest.sh` - gets latest from `Meadow.Core` and `Meadow.Foundation`

## DocFX stuff

You can link to APIs this way:
You can link to APIs this way, but you probably won't use it. This works _only_ within DocFX processed content and not within the general docs content.

* MD link notation: `[IApp](xref:Meadow.IApp)`
* `@` notation: `@"Meadow.IApp"`
Expand All @@ -63,7 +64,7 @@ The `@` notation is shorter, but the MD notation allows you to set the link titl

If it fails on Mac/Linux with some `SQLitePCLRaw` nonsense, run this:

```
```console
nuget install -OutputDirectory $TMPDIR SQLitePCLRaw.core -ExcludeVersion
for docfx in /usr/local/Cellar/docfx/*; do cp "$TMPDIR/SQLitePCLRaw.core/lib/net45/SQLitePCLRaw.core.dll" "$docfx/libexec"; done
```
Expand All @@ -78,7 +79,7 @@ Electronics tutorial copyright Bryan Costanich.

### Documentation Prose

All the documentation prose is released under a [Creative Commons
All the documentation prose is released under a [Creative Commons
Attribution + Noncommercial + NoDerivatives (CC BY-NC-ND) license](Licenses/CreativeCommons_BY_NC_ND.md). Feel free to share verbatim in non-commercial usage and provide attribution. Commercial usage may be granted in certain use cases. If you need a more permissive license, please contact us at [[email protected]](mailto:[email protected]).

![Creative Commons BY-NC-ND Logo](Licenses/Cc-by-nc-nd_icon.png)
Expand Down
16 changes: 8 additions & 8 deletions docs/Meadow/Release_Notes/Beta2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ To use it, your application must target .NET 4.7.2.

### New IO APIs

One of the big things weve been working on is a major rewrite of how IO is handled between the underlying OS and Mono (the managed runtime) where weve been able to simplify a lot of the underpinning there and make it much more efficient.
One of the big things we've been working on is a major rewrite of how IO is handled between the underlying OS and Mono (the managed runtime) where we've been able to simplify a lot of the underpinning there and make it much more efficient.

Along the way, weve also done a lot of thinking and reworking of the API. Specifically, weve added two new features. The first, is that the IO Devices are self describing with a mapping of `Device` > `Pins` > `Channels`. For instance, the following [Meadow sample code](https://github.com/WildernessLabs/Meadow_Samples/tree/main/Source/MeadowSamples/GpioInterrogation) enumerates all the pins and what type of IO is possible for each pin:
Along the way, we've also done a lot of thinking and reworking of the API. Specifically, we've added two new features. The first, is that the IO Devices are self describing with a mapping of `Device` > `Pins` > `Channels`. For instance, the following [Meadow sample code](https://github.com/WildernessLabs/Meadow_Samples/tree/main/Source/MeadowSamples/GpioInterrogation) enumerates all the pins and what type of IO is possible for each pin:

```csharp
foreach(var pin in Device.Pins.AllPins) {
Console.WriteLine("Found pin: " + pin.Name);
foreach (var channel in pin.SupportedChannels) {
Console.WriteLine("Contains a " + channel.GetType()
Console.WriteLine("Contains a " + channel.GetType()
+ "channel called: " + channel.Name + ".");
}
}
```

Heres an excerpt from the output the above code returns:
Here's an excerpt from the output the above code returns:

```bash
Found pin: A05
Expand All @@ -56,17 +56,17 @@ Contains a Meadow.Hardware.PwmChannelInfochannel called: TIM4_CH3.
Contains a Meadow.Hardware.CanChannelInfochannel called: CAN1_RX.
```

An astute observer familiar with the STM32F7 might notice that the analog port in the excerpt also exposes digital IO. Were now much more flexible in what types of IOs are exposed on which pins; which provides more options for you. In fact, now there's 25 possible digital IOs. With these [`IChannelInfo`](xref:Meadow.Hardware.IChannelInfo) objects, the IO is also self-documenting, and you can see what kind of ports are available from each pin without having to refer to the IO pinout diagram.
An astute observer familiar with the STM32F7 might notice that the analog port in the excerpt also exposes digital IO. We're now much more flexible in what types of IOs are exposed on which pins; which provides more options for you. In fact, now there's 25 possible digital IOs. With these `IChannelInfo` objects, the IO is also self-documenting, and you can see what kind of ports are available from each pin without having to refer to the IO pinout diagram.

#### Device-Centric API

Additionally, we made the API more device-centric. So instead of instantiating ports out of thin air (which was always just a little off); ports our now created via an [`IIODevice`](xref:Meadow.Hardware.IIODevice).
Additionally, we made the API more device-centric. So instead of instantiating ports out of thin air (which was always just a little off); ports our now created via an `IIODevice`.

```csharp
IDigitalOutputPort redLED = Device.CreateDigitalOutputPort(Device.Pins.OnboardLEDRed);
```

The great thing about this, is that it doesnt matter whether the ports are on the Meadow, or on external IO expanders, the API is the same. So we could also create a Digital Output Port from an MCP230xx IO expander, the same way:
The great thing about this, is that it doesn't matter whether the ports are on the Meadow, or on external IO expanders, the API is the same. So we could also create a Digital Output Port from an MCP230xx IO expander, the same way:

```csharp
var ledPort = mcp.CreateDigitalOutputPort(mcp.Pins.D04);
Expand Down Expand Up @@ -109,7 +109,7 @@ public class InputObservableApp : App<F7Micro, InputObservableApp>

public InputObservableApp()
{
// create an input port on D02.
// create an input port on D02.
_input = Device.CreateDigitalInputPort(Device.Pins.D02);

// Note that the filter is an optional parameter. If you're
Expand Down