Skip to content

Commit 569e6cb

Browse files
committed
Fixed broken links
1 parent 086097f commit 569e6cb

File tree

22 files changed

+200
-148
lines changed

22 files changed

+200
-148
lines changed

docs-old/source/Building.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ We generate [SLSA3 signatures](slsa.dev) using the OpenSSF's [slsa-framework/sls
7272
```shell
7373
$ slsa-verifier -artifact-path <downloaded.zip> -provenance attestation.intoto.jsonl -source github.com/google/flatbuffers -tag <version>
7474
PASSED: Verified SLSA provenance
75+
```
7576

7677
## Building for Android
7778

docs/source/annotation.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@ cd tests/annotated_binary
2828

2929
Which will produce a `annotated_binary.afb` file in the current directory.
3030

31+
The `annotated_binary.bin` is the flatbufer binary of the data contained within
32+
`annotated_binary.json`, which was made by the following command:
3133

32-
!!! Tip
33-
34-
The `annotated_binary.bin` is the flatbufer binary of the data contained
35-
within `annotated_binary.json`, which was made by the following command:
36-
37-
```sh
38-
..\..\flatc -b annotated_binary.fbs annotated_binary.json
39-
```
34+
```sh
35+
..\..\flatc -b annotated_binary.fbs annotated_binary.json
36+
```
4037

4138
## .afb Text Format
4239

docs/source/building.md

Lines changed: 88 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ Use `cmake` to configure a project based on your environment and platform.
1616
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release
1717
```
1818

19-
!!! note
20-
21-
To use `clang` instead of `gcc` you may need to set prepend some
22-
environment variables e.g. `CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake
23-
-G "Unix MakeFiles"`
19+
To use `clang` instead of `gcc` you may need to set prepend some environment
20+
variables e.g. `CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake -G "Unix
21+
MakeFiles"`
2422

2523
=== "Windows"
2624

@@ -78,3 +76,88 @@ Once the project files are generated, build as normal for your platform.
7876
## Building with Bazel
7977

8078
## Building with VCPKG
79+
80+
You can download and install flatbuffers using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
81+
82+
git clone https://github.com/Microsoft/vcpkg.git
83+
cd vcpkg
84+
./bootstrap-vcpkg.sh
85+
./vcpkg integrate install
86+
./vcpkg install flatbuffers
87+
88+
The flatbuffers port in vcpkg is kept up to date by Microsoft team members and community contributors.
89+
If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
90+
91+
92+
93+
## Building for Android
94+
95+
There is a `flatbuffers/android` directory that contains all you need to build
96+
the test executable on android (use the included `build_apk.sh` script, or use
97+
`ndk_build` / `adb` etc. as usual). Upon running, it will output to the log
98+
if tests succeeded or not.
99+
100+
You may also run an android sample from inside the `flatbuffers/samples`, by
101+
running the `android_sample.sh` script. Optionally, you may go to the
102+
`flatbuffers/samples/android` folder and build the sample with the
103+
`build_apk.sh` script or `ndk_build` / `adb` etc.
104+
105+
## Using FlatBuffers in your own projects
106+
107+
For C++, there is usually no runtime to compile, as the code consists of a
108+
single header, `include/flatbuffers/flatbuffers.h`. You should add the
109+
`include` folder to your include paths. If you wish to be
110+
able to load schemas and/or parse text into binary buffers at runtime,
111+
you additionally need the other headers in `include/flatbuffers`. You must
112+
also compile/link `src/idl_parser.cpp` (and `src/idl_gen_text.cpp` if you
113+
also want to be able convert binary to text).
114+
115+
To see how to include FlatBuffers in any of our supported languages, please
116+
view the [Tutorial](tutorial.md) and select your appropriate
117+
language using the radio buttons.
118+
119+
### Using in CMake-based projects
120+
If you want to use FlatBuffers in a project which already uses CMake, then a more
121+
robust and flexible approach is to build FlatBuffers as part of that project directly.
122+
This is done by making the FlatBuffers source code available to the main build
123+
and adding it using CMake's `add_subdirectory()` command. This has the
124+
significant advantage that the same compiler and linker settings are used
125+
between FlatBuffers and the rest of your project, so issues associated with using
126+
incompatible libraries (eg debug/release), etc. are avoided. This is
127+
particularly useful on Windows.
128+
129+
Suppose you put FlatBuffers source code in directory `${FLATBUFFERS_SRC_DIR}`.
130+
To build it as part of your project, add following code to your `CMakeLists.txt` file:
131+
```cmake
132+
# Add FlatBuffers directly to our build. This defines the `flatbuffers` target.
133+
add_subdirectory(${FLATBUFFERS_SRC_DIR}
134+
${CMAKE_CURRENT_BINARY_DIR}/flatbuffers-build
135+
EXCLUDE_FROM_ALL)
136+
137+
# Now simply link against flatbuffers as needed to your already declared target.
138+
# The flatbuffers target carry header search path automatically if CMake > 2.8.11.
139+
target_link_libraries(own_project_target PRIVATE flatbuffers)
140+
```
141+
When build your project the `flatbuffers` library will be compiled and linked
142+
to a target as part of your project.
143+
144+
#### Override default depth limit of nested objects
145+
To override [the depth limit of recursion](languages/cpp.md),
146+
add this directive:
147+
```cmake
148+
set(FLATBUFFERS_MAX_PARSING_DEPTH 16)
149+
```
150+
to `CMakeLists.txt` file before `add_subdirectory(${FLATBUFFERS_SRC_DIR})` line.
151+
152+
## Downloading binaries
153+
You can download the binaries from the
154+
[GitHub release page](https://github.com/google/flatbuffers/releases).
155+
156+
We generate [SLSA3 signatures](http://slsa.dev) using the OpenSSF's [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator). To verify the binaries:
157+
1. Install the verification tool from [slsa-framework/slsa-verifier#installation](https://github.com/slsa-framework/slsa-verifier#installation)
158+
1. Download the file named `attestation.intoto.jsonl` from the GitHub release
159+
1. Run:
160+
```shell
161+
$ slsa-verifier -artifact-path <downloaded.zip> -provenance attestation.intoto.jsonl -source github.com/google/flatbuffers -tag <version>
162+
PASSED: Verified SLSA provenance
163+
```

docs/source/evolution.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ of the added field if accessed).
2020

2121
Older code will simply ignore the new field in the flatbuffer.
2222

23-
!!! tip "Use `id` attributes"
24-
25-
You can ignore this rule if you use the `id` attribute on all the fields of a table.
23+
You can ignore this rule if you use the `id` attribute on all the fields of a
24+
table.
2625

2726
### Removal
2827

docs/source/flexbuffers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ map.get("unknown").isNull(); // true
163163
# Binary encoding
164164

165165
A description of how FlexBuffers are encoded is in the
166-
[internals](@ref flatbuffers_internals) document.
166+
[internals](internals.md) document.
167167

168168

169169
# Nesting inside a FlatBuffer

docs/source/internals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ that may further help clarify the format.
316316

317317
# FlexBuffers
318318

319-
The [schema-less](@ref flexbuffers) version of FlatBuffers have their
319+
The [schema-less](flexbuffers.md) version of FlatBuffers have their
320320
own encoding, detailed here.
321321

322322
It shares many properties mentioned above, in that all data is accessed

docs/source/languages/c.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ project.
1212

1313
## General Documention
1414

15-
- [Tutorial](@ref flatbuffers_guide_tutorial) - select C as language
15+
- [Tutorial](../tutorial.md) - select C as language
1616
when scrolling down
1717
- [FlatCC Guide](https://github.com/dvidelabs/flatcc#flatcc-flatbuffers-in-c-for-c)
1818
- [The C Builder Interface](https://github.com/dvidelabs/flatcc/blob/master/doc/builder.md#the-builder-interface)

docs/source/languages/c_sharp.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Use in C\# {#flatbuffers_guide_use_c-sharp}
44
## Before you get started
55

66
Before diving into the FlatBuffers usage in C#, it should be noted that
7-
the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide to
7+
the [Tutorial](../tutorial.md) page has a complete guide to
88
general FlatBuffers usage in all of the supported languages (including C#).
99
This page is designed to cover the nuances of FlatBuffers usage,
1010
specific to C#.
1111

12-
You should also have read the [Building](@ref flatbuffers_guide_building)
12+
You should also have read the [Building](../building.md)
1313
documentation to build `flatc` and should be familiar with
14-
[Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and
15-
[Writing a schema](@ref flatbuffers_guide_writing_schema).
14+
[Using the schema compiler](../flatc.md) and
15+
[Writing a schema](../schema.md).
1616

1717
## FlatBuffers C# code location
1818

@@ -62,7 +62,7 @@ by running the following commands from inside the `FlatBuffers.Test` folder:
6262

6363
## Using the FlatBuffers C# library
6464

65-
*Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth
65+
*Note: See [Tutorial](../tutorial.md) for a more in-depth
6666
example of how to use FlatBuffers in C#.*
6767

6868
FlatBuffers supports reading and writing binary FlatBuffers in C#.
@@ -141,7 +141,7 @@ To use it:
141141

142142
## Buffer verification
143143

144-
As mentioned in [C++ Usage](@ref flatbuffers_guide_use_cpp) buffer
144+
As mentioned in [C++ Usage](cpp.md) buffer
145145
accessor functions do not verify buffer offsets at run-time.
146146
If it is necessary, you can optionally use a buffer verifier before you
147147
access the data. This verifier will check all offsets, all sizes of

docs/source/languages/cpp.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## Before you get started
44

55
Before diving into the FlatBuffers usage in C++, it should be noted that
6-
the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide
6+
the [Tutorial](../tutorial.md) page has a complete guide
77
to general FlatBuffers usage in all of the supported languages (including C++).
88
This page is designed to cover the nuances of FlatBuffers usage, specific to
99
C++.
@@ -12,8 +12,8 @@ C++.
1212

1313
This page assumes you have written a FlatBuffers schema and compiled it
1414
with the Schema Compiler. If you have not, please see
15-
[Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler)
16-
and [Writing a schema](@ref flatbuffers_guide_writing_schema).
15+
[Using the schema compiler](../flatc.md)
16+
and [Writing a schema](../schema.md).
1717

1818
Assuming you wrote a schema, say `mygame.fbs` (though the extension doesn't
1919
matter), you've generated a C++ header called `mygame_generated.h` using the
@@ -34,15 +34,15 @@ The test code itself is located in
3434
[test.cpp](https://github.com/google/flatbuffers/blob/master/tests/test.cpp).
3535

3636
This test file is built alongside `flatc`. To review how to build the project,
37-
please read the [Building](@ref flatbuffers_guide_building) documentation.
37+
please read the [Building](../building.md) documentation.
3838

3939
To run the tests, execute `flattests` from the root `flatbuffers/` directory.
4040
For example, on [Linux](https://en.wikipedia.org/wiki/Linux), you would simply
4141
run: `./flattests`.
4242

4343
## Using the FlatBuffers C++ library
4444

45-
*Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth
45+
*Note: See [Tutorial](../tutorial.md) for a more in-depth
4646
example of how to use FlatBuffers in C++.*
4747

4848
FlatBuffers supports both reading and writing FlatBuffers in C++.
@@ -261,7 +261,7 @@ using hashes which are then represented as typed pointers in the object API.
261261

262262
To make this work have a field in the objects you want to referred to which is
263263
using the string hashing feature (see `hash` attribute in the
264-
[schema](@ref flatbuffers_guide_writing_schema) documentation). Then you have
264+
[schema](../schema.md) documentation). Then you have
265265
a similar hash in the field referring to it, along with a `cpp_type`
266266
attribute specifying the C++ type this will refer to (this can be any C++
267267
type, and will get a `*` added).
@@ -555,11 +555,11 @@ recursion depth. Number of nested declarations in a schema or number of
555555
nested json-objects is limited. By default, this depth limit set to `64`.
556556
It is possible to override this limit with `FLATBUFFERS_MAX_PARSING_DEPTH`
557557
definition. This definition can be helpful for testing purposes or embedded
558-
applications. For details see [build](@ref flatbuffers_guide_building) of
558+
applications. For details see [build](../building.md) of
559559
CMake-based projects.
560560

561561
## Dependence from C-locale {#flatbuffers_locale_cpp}
562-
The Flatbuffers [grammar](@ref flatbuffers grammar) uses ASCII
562+
The Flatbuffers [grammar](../grammar.md) uses ASCII
563563
character set for identifiers, alphanumeric literals, reserved words.
564564

565565
Internal implementation of the Flatbuffers depends from functions which
@@ -602,7 +602,7 @@ compatible with the `IEEE-754` floating-point standard.
602602
The schema and json parser may fail if `fast-math` or `/fp:fast` mode is active.
603603

604604
### Support of hexadecimal and special floating-point numbers
605-
According to the [grammar](@ref flatbuffers_grammar) `fbs` and `json` files
605+
According to the [grammar](../grammar.md) `fbs` and `json` files
606606
may use hexadecimal and special (`NaN`, `Inf`) floating-point literals.
607607
The Flatbuffers uses `strtof` and `strtod` functions to parse floating-point
608608
literals. The Flatbuffers library has a code to detect a compiler compatibility
@@ -625,7 +625,7 @@ According to the `IEEE-754`, a comparison with `NaN` always returns
625625
an unordered result even when compared with itself. As a result, a whole
626626
Flatbuffers object will be not equal to itself if has one or more `NaN`.
627627
Flatbuffers scalar fields that have the default value are not actually stored
628-
in the serialized data but are generated in code (see [Writing a schema](@ref flatbuffers_guide_writing_schema)).
628+
in the serialized data but are generated in code (see [Writing a schema](../schema.md)).
629629
Scalar fields with `NaN` defaults break this behavior.
630630
If a schema has a lot of `NaN` defaults the Flatbuffers can override
631631
the unordered comparison by the ordered: `(NaN==NaN)->true`.

docs/source/languages/dart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Use in Dart {#flatbuffers_guide_use_dart}
44
## Before you get started
55

66
Before diving into the FlatBuffers usage in Dart, it should be noted that
7-
the [Tutorial](@ref flatbuffers_guide_tutorial) page has a complete guide
7+
the [Tutorial](../tutorial.md) page has a complete guide
88
to general FlatBuffers usage in all of the supported languages (including Dart).
99
This page is designed to cover the nuances of FlatBuffers usage, specific to
1010
Dart.
1111

12-
You should also have read the [Building](@ref flatbuffers_guide_building)
12+
You should also have read the [Building](../building.md)
1313
documentation to build `flatc` and should be familiar with
14-
[Using the schema compiler](@ref flatbuffers_guide_using_schema_compiler) and
15-
[Writing a schema](@ref flatbuffers_guide_writing_schema).
14+
[Using the schema compiler](../flatc.md) and
15+
[Writing a schema](../schema.md).
1616

1717
## FlatBuffers Dart library code location
1818

@@ -34,7 +34,7 @@ to be installed.*
3434

3535
## Using the FlatBuffers Dart library
3636

37-
*Note: See [Tutorial](@ref flatbuffers_guide_tutorial) for a more in-depth
37+
*Note: See [Tutorial](../tutorial.md) for a more in-depth
3838
example of how to use FlatBuffers in Dart.*
3939

4040
FlatBuffers supports reading and writing binary FlatBuffers in Dart.

0 commit comments

Comments
 (0)