From e9dfee18a6cd7ec0cbe478a6fb60eb01f00771bf Mon Sep 17 00:00:00 2001 From: Jared Rummler Date: Wed, 27 Mar 2024 23:20:08 -0700 Subject: [PATCH 1/4] Update README.md --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1daf1e9..40e165b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# GoatStyles by GoatBytes.IO`() {` +# [GoatStyles][GS] by [GoatBytes.IO][GB]`() {` ## Introduction @@ -102,13 +102,14 @@ Python version by running `python --version` in your terminal. ## License -[GoatStyles][GoatStylesRepo] © 2024 by [GoatBytes.IO][GoatBytes.IO] is licensed under [Attribution-ShareAlike 4.0 International][LicenseUrl] +[GoatStyles][GH] is licensed under [Attribution-ShareAlike 4.0 International][LICENSE] # `};` -[GoatBytes.IO]: https://goatbytes.io -[GoatStylesRepo]: https://github.com/goatbytes/GoatStyles -[LicenseUrl]: https://creativecommons.org/licenses/by-sa/4.0/ +[GS]: https://styles.goatbytes.io +[GB]: https://goatbytes.io +[GH]: https://github.com/goatbytes/GoatStyles +[LICENSE]: https://creativecommons.org/licenses/by-sa/4.0/ [CLA]: https://forms.gle/J5iqyH4hrHQQDfUCA From 1da542ac51e3be9bf91069bea8663a845d61f917 Mon Sep 17 00:00:00 2001 From: Jared Rummler Date: Thu, 28 Mar 2024 09:24:06 -0700 Subject: [PATCH 2/4] docs: Update sections for clarity, move files --- README.md | 2 +- docs/{styles => }/foundation.md | 5 +- docs/index.md | 20 ++- docs/{styles => lang}/cpp.md | 150 +++++++------------ docs/{styles => lang}/csharp.md | 132 +++++++--------- docs/{styles => lang}/dart.md | 81 +++++++--- docs/{styles => lang}/go.md | 23 ++- docs/{styles => lang}/java.md | 16 +- docs/{styles => lang}/javascript.md | 16 +- docs/{styles => lang}/kotlin.md | 99 ++++++------ docs/{styles/objc.md => lang/objective-c.md} | 16 +- docs/{styles => lang}/python.md | 11 +- docs/{styles => lang}/rust.md | 12 +- docs/{styles => lang}/shell.md | 9 +- docs/{styles => lang}/swift.md | 19 ++- docs/{styles => lang}/typescript.md | 26 ++-- 16 files changed, 316 insertions(+), 321 deletions(-) rename docs/{styles => }/foundation.md (99%) rename docs/{styles => lang}/cpp.md (69%) rename docs/{styles => lang}/csharp.md (66%) rename docs/{styles => lang}/dart.md (85%) rename docs/{styles => lang}/go.md (90%) rename docs/{styles => lang}/java.md (96%) rename docs/{styles => lang}/javascript.md (97%) rename docs/{styles => lang}/kotlin.md (85%) rename docs/{styles/objc.md => lang/objective-c.md} (96%) rename docs/{styles => lang}/python.md (92%) rename docs/{styles => lang}/rust.md (97%) rename docs/{styles => lang}/shell.md (95%) rename docs/{styles => lang}/swift.md (95%) rename docs/{styles => lang}/typescript.md (86%) diff --git a/README.md b/README.md index 40e165b..bb5c5a1 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ development environments, catering to the diverse needs of the software developm ### Repository Structure The GoatStyles style guides are meticulously documented in Markdown and located within the -[`docs/styles`](docs/styles) directory of the repository. +[`docs/styles`](docs/lang) directory of the repository. ## How to Contribute diff --git a/docs/styles/foundation.md b/docs/foundation.md similarity index 99% rename from docs/styles/foundation.md rename to docs/foundation.md index feb7405..f3f1dc4 100644 --- a/docs/styles/foundation.md +++ b/docs/foundation.md @@ -103,7 +103,7 @@ conventions. ### Whitespace - Include a space before parentheses and the left brace `{` for control structures -- (`if`, `for`, `while`, etc.). + (`if`, `for`, `while`, etc.). - Include Space around all operators (`->`, `=`, `+`, `*`, `/`, `>>`, etc.), except before unary and range operators. - Include a space before `else`, `catch`, and `finally` keywords. @@ -153,8 +153,7 @@ Use blank lines strategically to separate logical blocks of code for better read * - Consistent spacing for parameter lists and constructor arguments. * - Doc comments with aligned descriptions. */ - -class WellFormattedCode { // (1)! +class WellFormattedCode/*(1)!*/ { public: /** * This method calculates the factorial of a given positive integer. diff --git a/docs/index.md b/docs/index.md index 445b151..3935376 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,14 +1,22 @@ # GoatStyles — Professional Code Style Guides -:wave: Welcome to our platform for professional code style guides, where we strive to uphold the highest standards of software engineering. +:wave: Welcome to our platform for professional code style guides, where we strive to uphold the +highest standards of software engineering. -In the realm of code style guides, we understand that opinions vary, and decisions often balance between necessity and subjectivity. However, amidst this diversity of perspectives, one principle remains paramount: consistency. Just as collaboration and cohesion within teams foster unity, a unified code style promotes clarity amidst diversity, enhancing comprehension and simplifying maintenance. - -By adhering to a consistent style, we aim to accelerate understanding and streamline maintenance, enabling engineers to navigate complex systems with ease. Championing accessibility and openness, we advocate for code that remains universally understandable, transcending individual preferences to embrace standards of clarity and coherence. +In the realm of code style guides, we understand that opinions vary, and decisions often balance +between necessity and subjectivity. However, amidst this diversity of perspectives, one principle +remains paramount: __consistency__. By adhering to a consistent style, developers can enhance +readability, maintainability, and collaboration within their codebases. The +[Foundational Code Standards](foundation.md) serve as a universal guideline, ensuring that +language-specific style guides uphold these ideals of clarity and cohesiveness. ## Language-Specific Style Guidelines -[cards cols=6 (./docs/assets/cards/languages.json)] +[cards cols=4 (./docs/assets/cards/languages.json)] /// admonition | -Each guideline outlined in our style guides is carefully curated to promote best practices and address common pitfalls specific to the respective programming languages. By following these guidelines, developers can write code that is not only consistent but also optimized for readability and maintainability. +Each guideline outlined in our style guides is carefully curated to promote best practices and +address common pitfalls specific to the respective programming languages. By following these +guidelines, developers can write code that is not only consistent but also optimized for readability +and maintainability. +/// diff --git a/docs/styles/cpp.md b/docs/lang/cpp.md similarity index 69% rename from docs/styles/cpp.md rename to docs/lang/cpp.md index 75854c2..d94bf43 100644 --- a/docs/styles/cpp.md +++ b/docs/lang/cpp.md @@ -6,20 +6,19 @@ C++-specific considerations. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for C++. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for C++. /// [//]: # (@formatter:on) ## Formatting -While our C++ formatting guidelines follows the [Foundational Code Standards][fnd-formatting] for -formatting, summarized below: +The formatting rules for C++ adhere to our foundational [formatting standards][FORMATTING] with the +following exceptions: - **Indentation:** Use 4 spaces for indentation. - **Continuation indent:** Use 8 spaces for line continuations. -Otherwise, adhere to the general formatting guidelines outlined in the foundational standards and -briefly summarized below. +Otherwise, follow the conventions outlined in the foundational standards, summarized below: - **Line Length:** Aim for 100 characters, but allow flexibility for readability. - **Whitespace:** Use spaces around operators, parentheses, braces, colons, commas, and keywords for @@ -34,99 +33,70 @@ briefly summarized below. Remember, these are guidelines; adapt them for your project's needs while keeping readability in focus. /// -/// details | Formatted C++ Example Code - type: example -```cpp -#include -#include +## Naming Conventions -// Attributes used for demonstration -[[nodiscard]] class Example { -public: - // Constructor with initializer list - Example(int x, int y) : x_(x), y_(y) {} +The naming conventions for Kotlin adhere to our foundational [naming conventions][NAMING] +with no exceptions. - // Method declaration - void doSomething(); +- **PascalCase** for classes, interfaces, enums (definitions). +- **camelCase** for functions, variables, properties. + - Prefix booleans with `is` or `has` for clarity. +- **UPPER_SNAKE_CASE** for constants. +- **lowercase** package names, concatenated words (avoid underscores). -private: - int x_; - int y_; - - // Inner class - class Inner { - public: - void innerMethod() { - std::cout << "Inside innerMethod" << std::endl; +--- + +**Example** + +```cpp +/** + * This class demonstrates proper code formatting following the specified style guide. + * + * **Formatting Rules:** + * - 4 spaces for indentation (C++ exception). + * - 8 spaces for continuation lines (C++ exception). + * - Max line length of 100 characters. + * - Spaces around operators, control structures, and keywords. + * - K&R brace style. + * - Consistent spacing for parameter lists and constructor arguments. + * - Doc comments with aligned descriptions. + */ +class WellFormattedCode/*(1)!*/ { +public: + /** + * This method calculates the factorial of a given positive integer. + * + * @param n The non-negative integer for which to calculate the factorial. + * @return The factorial of n, or throws an std::invalid_argument exception if n is negative. + * @throws std::invalid_argument If the provided number (n) is negative. + */ + static long calculateFactorial/*(2)!*/(int n) { + if (n < 0) {// (3)! + throw std::invalid_argument("Factorial is not defined for negative numbers."); } - }; - // Example of a static method - static void staticMethod() { - if (true) { - std::cout << "Static method called" << std::endl; + long result = 1; + for (int i = 2; i <=/*(4)!*/ n; ++i) { + result *= i; } + return result; } }; - -void Example::doSomething() { - Inner inner; - inner.innerMethod(); - - int sum = x_ + y_; // Demonstrating space around operator - std::cout << "Sum: " << sum << std::endl; - - // For loop demonstrating continuation indent and spaces - for (int i = 0; i < 10; i += 2) { - std::cout << i << " "; - } - std::cout << std::endl; - - // If-else structure - if (sum > 10) { - std::cout << "Sum is greater than 10" << std::endl; - } else { - std::cout << "Sum is 10 or less" << std::endl; - } - - // Try-catch block - try { - throw std::runtime_error("Example exception"); - } catch (const std::runtime_error& e) { - std::cout << "Caught an exception: " << e.what() << std::endl; - } -} - -int main() { - Example example(5, 8); - example.doSomething(); - Example::staticMethod(); - - return 0; -} ``` -/// +1. Class name in PascalCase with a doc comment. +2. Method name in camelCase with a doc comment. +3. K&R brace style for blocks. +4. Proper spacing around operators and control structures. [//]: # (@formatter:on) -## Naming Conventions - -The naming conventions for Kotlin adhere to our [Foundational Code Standards][fnd-naming] -with no exceptions. - -- **PascalCase** for classes, interfaces, enums (definitions). -- **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. -- **UPPER_SNAKE_CASE** for constants. -- **lowercase** package names, concatenated words (avoid underscores). - -[//]: # (TODO: Add good/bad examples for naming conventions) +--- ## Documentation and Comments -Refer to the [Foundational Code Standards][fnd-docs] for general commenting and documentation -guidelines. +Refer to the [Foundational Documentation and Comments Standards][DOCS] for general commenting and +documentation guidelines. ### Documentation Example @@ -144,7 +114,7 @@ guidelines. * **Usage Example:** * ` * Goat billy("Billy", 5); - * std::cout << (billy.isHappy(3) ? "True" : "False") << std::endl; // Outputs "True" or "False" based on the number of meals. + * std::cout << (billy.isHappy(3) ? "True" : "False") << std::endl; * ` * * @author Author's Name @@ -181,12 +151,6 @@ private: int age_; }; -int main() { - Goat billy("Billy", 5); - std::cout << "Billy is " << (billy.isHappy(3) ? "happy" : "not happy") << std::endl; - - return 0; -} ``` ## Idioms and Best Practices @@ -258,9 +222,9 @@ resources: aspects of C++ programming, from basics to advanced topics. [//]: # (@formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Effective Modern C++]: https://www.oreilly.com/library/view/effective-modern-c/9781491908419/ [//]: # (@formatter:on) \ No newline at end of file diff --git a/docs/styles/csharp.md b/docs/lang/csharp.md similarity index 66% rename from docs/styles/csharp.md rename to docs/lang/csharp.md index 80b722d..2cf5f7b 100644 --- a/docs/styles/csharp.md +++ b/docs/lang/csharp.md @@ -6,19 +6,17 @@ C#-specific considerations. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for C#. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for C#. /// [//]: # (@formatter:on) ## Formatting -The formatting guidelines for C# closely adhere to -our [Foundational Code Standards][fnd-formatting]. Here is a brief overview: +The formatting rules for C# adhere to our foundational [formatting standards][FORMATTING]: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. -- **Whitespace:** Use spaces around operators, parentheses, braces, colons, commas, and keywords for - clarity. +- **Whitespace:** Use spaces around operators, parentheses, braces, colons, commas, and keywords. - **Brace Style:** Follow K&R style (opening brace on same line, closing brace on new line). - **Blank Lines:** Use 1 line to separate code sections. - **Alignment:** Align elements in documentation comments and parameter lists. @@ -28,96 +26,68 @@ our [Foundational Code Standards][fnd-formatting]. Here is a brief overview: type: info Remember, these are guidelines; adapt them for your project's needs while keeping readability in focus. /// +[//]: # (@formatter:on) -/// details | Formatted C# Example Code - type: example -```csharp -using System; - -// Attribute used for demonstration -[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] -public class DemoAttribute : Attribute {} - -[Demo] -public class Example { - private int x; - private int y; +## Naming Conventions - // Constructor - public Example(int x, int y) { - this.x = x; - this.y = y; - } +The naming conventions for C# adhere to our foundational [naming conventions][NAMING]: - // Method demonstrating various style rules - public void PerformOperations() { - Inner inner = new Inner(); - inner.Display(); +- **PascalCase** for classes, interfaces, enums (definitions). +- **camelCase** for functions, variables, properties. + - Prefix booleans with `is` or `has` for clarity. +- **UPPER_SNAKE_CASE** for constants. +- **lowercase** for namespaces, concatenated words (avoid underscores). - int sum = x + y; // Space around operators - Console.WriteLine($"Sum: {sum}"); +--- - // Ternary operator with spaces - string message = sum > 10 ? "Greater than 10" : "Not greater than 10"; - Console.WriteLine(message); +**Example** - // If-else with spacing and brace style - if (sum % 2 == 0) { - Console.WriteLine("Sum is even"); - } else { - Console.WriteLine("Sum is odd"); +```csharp +/** + * This class demonstrates proper code formatting following the specified style guide. + * + * **Formatting Rules:** + * - Indentation: 2 spaces (C# standard). + * - Max line length of 100 characters. + * - Spaces around operators, control structures, and keywords. + * - K&R brace style (opening brace on the same line as the statement). + * - Consistent spacing for parameter lists and constructor arguments. + * - Doc comments with aligned descriptions. + */ +public class WellFormattedCode { // (1)! + /** + * This method calculates the factorial of a given positive integer. + * + * @param n The non-negative integer for which to calculate the factorial. + * @return The factorial of n, or throws an ArgumentOutOfRangeException if n is negative. + * @throws ArgumentOutOfRangeException If the provided number (n) is negative. + */ + public static long CalculateFactorial(int n) { // (2)! + if (n < 0) { // (3)! + throw new ArgumentOutOfRangeException(nameof(n), "Factorial is not defined for negative numbers."); } - // For loop demonstrating continuation indent - for (int i = 0; i < 5; i++) { - Console.Write(i + " "); // Demonstrate space in concatenation - } - Console.WriteLine(); - - // Try-catch-finally block - try { - throw new InvalidOperationException("Demo exception"); - } catch (InvalidOperationException ex) { - Console.WriteLine($"Caught exception: {ex.Message}"); - } finally { - Console.WriteLine("Finally block executed"); + long result = 1; + for (int i = 2; i <= n; i++) { // (4)! + result *= i; } - } - - // Inner class - private class Inner { - public void Display() { - Console.WriteLine("Inside Inner class"); - } - } -} - -class Program { - static void Main(string[] args) { - Example example = new Example(3, 7); - example.PerformOperations(); + return result; } } ``` -/// -[//]: # (@formatter:on) -## Naming Conventions +1. Class name in PascalCase with a doc comment. +2. Method name in camelCase with a doc comment. +3. K&R brace style for blocks. +4. Proper spacing around operators and control structures. -The naming conventions for C# adhere to our [Foundational Code Standards][fnd-naming] with no -exceptions. - -- **PascalCase** for classes, interfaces, enums (definitions). -- **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. -- **UPPER_SNAKE_CASE** for constants. -- **lowercase** for namespaces, concatenated words (avoid underscores). +[//]: # (@formatter:on) -[//]: # (TODO: Add good/bad examples for naming conventions) +--- ## Documentation and Comments -Refer to the [Foundational Code Standards][fnd-docs] for general commenting and documentation +Refer to the [Foundational Code Standards][DOCS] for general commenting and documentation guidelines. ## Idioms and Best Practices @@ -229,9 +199,9 @@ several tools are particularly effective: articles, tutorials, and forums on C# programming and .NET development. [//]: # (@formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Roslyn]: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview [//]: # (@formatter:on) diff --git a/docs/styles/dart.md b/docs/lang/dart.md similarity index 85% rename from docs/styles/dart.md rename to docs/lang/dart.md index a139dff..927b499 100644 --- a/docs/styles/dart.md +++ b/docs/lang/dart.md @@ -6,19 +6,20 @@ aligning with Dart's conventions and best practices. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Dart. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Dart. /// [//]: # (@formatter:on) ## Formatting -Dart formatting is automated with `dartfmt`, ensuring consistent code style across all Dart -projects: +The formatting rules for Dart adhere to our foundational [formatting standards][FORMATTING]: -- **Indentation:** Use 2 spaces for indentation. -- **Line Length:** While the default line length for Dart is 80 characters, we recommend adjusting - this to 100 characters for better readability. -- **Braces:** Opening braces are placed on the same line as the statement. +- **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. +- **Line Length:** Aim for 100 characters, but allow flexibility for readability. +- **Whitespace:** Use spaces around operators, parentheses, braces, colons, commas, and keywords. +- **Brace Style:** Follow K&R style (opening brace on same line, closing brace on new line). +- **Blank Lines:** Use 1 line to separate code sections. +- **Alignment:** Align elements in documentation comments and parameter lists. ## Naming Conventions @@ -27,10 +28,56 @@ Dart employs specific naming conventions to enhance readability and maintain con - **PascalCase** for classes, enum types, and type parameters. - **snake_case** for libraries, packages, directories, and source files. - **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. + - Prefix booleans with `is` or `has` for clarity. - **camelCase** for functions, variables, constants, and parameters. - Prefix global constants with a lowercase `k` before `CamelCase`. +--- + +**Example** + + +```dart +/** + * This class demonstrates proper code formatting following the specified style guide. + * + * **Formatting Rules:** + * - 2 spaces for indentation (Dart standard). + * - Max line length of 100 characters. + * - Spaces around operators, control structures, and keywords. + * - K&R brace style. + * - Consistent spacing for parameter lists and constructor arguments. + * - Doc comments with aligned descriptions. + */ +class WellFormattedCode { // (1)! + /** + * This method calculates the factorial of a given positive integer. + * + * @param n The non-negative integer for which to calculate the factorial. + * @return The factorial of n, or throws an ArgumentError if n is negative. + * @throws ArgumentError If the provided number (n) is negative. + */ + int calculateFactorial(int n) { // (2)! + if (n < 0) { // (3)! + throw ArgumentError('Factorial is not defined for negative numbers.'); + } + + int result = 1; + for (int i = 2; i <= n; i++) { // (4)! + result *= i; + } + return result; + } +} +``` + +1. Class name in PascalCase with a doc comment. +2. Method name in camelCase with a doc comment. +3. K&R brace style for blocks. +4. Proper spacing around operators and control structures. + +--- + ## Commenting and Documentation ### DartDoc @@ -60,11 +107,11 @@ insights into the code's purpose and usage. /// /// Stores information about the goat's name and feeding status. class Goat { - /// The name of the goat. - final String name; + /// The name of the goat. + final String name; - /// Creates a [Goat] with the given [name]. - Goat(this.name); + /// Creates a [Goat] with the given [name]. + Goat(this.name); } ``` @@ -77,7 +124,7 @@ insights into the code's purpose and usage. /// /// Returns `true` if the goat was fed successfully. bool feedGoat(Goat goat, String food) { - // Implementation + // Implementation } ``` @@ -451,10 +498,10 @@ and potential problems. [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Effective Dart]: https://dart.dev/guides/language/effective-dart [Dart Language Tour]: https://dart.dev/guides/language/language-tour [Dart Linter]: https://dart.dev/tools/linter-rules diff --git a/docs/styles/go.md b/docs/lang/go.md similarity index 90% rename from docs/styles/go.md rename to docs/lang/go.md index 81afec6..4f95975 100644 --- a/docs/styles/go.md +++ b/docs/lang/go.md @@ -6,13 +6,13 @@ that is clean, readable, maintainable, and idiomatic to the Go programming langu [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Go. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Go. /// [//]: # (@formatter:on) ## Formatting -While our [Foundational Formatting Standards][fnd-formatting] provide comprehensive formatting +While our foundational [formatting standards][FORMATTING] provide comprehensive formatting guidelines, you should also use `gofmt` to ensure consistency across all Go code. - **Indentation:** `gofmt` uses tabs for indentation. **Do not use spaces.** @@ -23,8 +23,15 @@ guidelines, you should also use `gofmt` to ensure consistency across all Go code ## Naming Conventions -In addition to following our [Foundational Naming Conventions][fnd-naming], adhere to Go's naming -conventions: +Adhere to the foundational [naming conventions][NAMING]: + +- **PascalCase** for classes, protocols, and enumeration types +- **camelCase** for methods, variables, and properties. + - Prefix booleans with `is` or `has` for clarity. +- **UPPER_SNAKE_CASE** for constants. +- **lowercase** package names, concatenated words (avoid underscores). + +In addition, adhere to Go's naming convention recommendations: - **Local Variables:** Short, but descriptive names. Single letter names are common for small scopes - **Acronyms:** Keep acronyms in uppercase. For example, use `HTTPRequest` instead of `HttpRequest`. @@ -251,10 +258,10 @@ func main() { [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [gofmt]: https://pkg.go.dev/cmd/gofmt [Staticcheck]: https://staticcheck.io/ [Effective Go]: https://golang.org/doc/effective_go.html diff --git a/docs/styles/java.md b/docs/lang/java.md similarity index 96% rename from docs/styles/java.md rename to docs/lang/java.md index f694062..d81731f 100644 --- a/docs/styles/java.md +++ b/docs/lang/java.md @@ -6,13 +6,13 @@ focusing on readability, maintainability, and idiomatic usage. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Java. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Java. /// [//]: # (@formatter:on) ## Formatting -The formatting guidelines for Kotlin adhere to our [Foundational Code Standards][fnd-formatting]. +The formatting guidelines for Kotlin adhere to our [Foundational Code Standards][FORMATTING]. Here is a brief overview: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. @@ -32,12 +32,12 @@ focus. ## Naming Conventions -The naming conventions for Kotlin adhere to our [Foundational Code Standards][fnd-naming] +The naming conventions for Kotlin adhere to our [Foundational Code Standards][NAMING] with no exceptions. - **PascalCase** for classes, interfaces, enums (definitions). - **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. + - Prefix booleans with `is` or `has` for clarity. - **UPPER_SNAKE_CASE** for constants. - **lowercase** package names, concatenated words (avoid underscores). @@ -288,10 +288,10 @@ public class GoatFeeder { [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Oracle Java Tutorials]: https://docs.oracle.com/javase/tutorial/ [Effective Java]: https://www.pearson.com/us/higher-education/program/Bloch-Effective-Java-3rd-Edition/PGM334830.html diff --git a/docs/styles/javascript.md b/docs/lang/javascript.md similarity index 97% rename from docs/styles/javascript.md rename to docs/lang/javascript.md index 6c0c248..c466fa8 100644 --- a/docs/styles/javascript.md +++ b/docs/lang/javascript.md @@ -7,14 +7,14 @@ practices while also incorporating unique aspects of JavaScript programming. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for JavaScript. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for JavaScript. /// [//]: # (@formatter:on) ## Formatting The formatting guidelines for JavaScript adhere to our -[Foundational Code Standards][fnd-formatting]. Here is a brief overview: +[Foundational Code Standards][FORMATTING]. Here is a brief overview: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. @@ -102,12 +102,12 @@ main(); ## Naming Conventions -The naming conventions for Kotlin adhere to our [Foundational Code Standards][fnd-naming] +The naming conventions for Kotlin adhere to our [Foundational Code Standards][NAMING] with no exceptions. - **PascalCase** for classes, interfaces, enums (definitions). - **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. + - Prefix booleans with `is` or `has` for clarity. - **UPPER_SNAKE_CASE** for constants. - **lowercase** package names, concatenated words (avoid underscores). @@ -429,9 +429,9 @@ setup is pivotal for enhancing productivity, ensuring code quality, and facilita JavaScript features, APIs, and best practices. [//]: # (@formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Roslyn]: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview [//]: # (@formatter:on) diff --git a/docs/styles/kotlin.md b/docs/lang/kotlin.md similarity index 85% rename from docs/styles/kotlin.md rename to docs/lang/kotlin.md index 7359dec..b456d42 100644 --- a/docs/styles/kotlin.md +++ b/docs/lang/kotlin.md @@ -6,14 +6,13 @@ Kotlin-specific considerations. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Kotlin. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Kotlin. /// [//]: # (@formatter:on) ## Formatting -The formatting guidelines for Kotlin adhere to our [Foundational Code Standards][fnd-formatting]. -Here is a brief overview: +Adhere to the foundational [formatting stadards][FORMATTING]: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. @@ -34,71 +33,57 @@ Here is a brief overview: type: example ```kotlin -import kotlin.Exception - -// Annotation used for demonstration -annotation class DemoAnnotation(val description: String) - -@DemoAnnotation(description = "Class demonstrating style rules") -class Example(private val x: Int, private val y: Int) { - - // Method demonstrating various style rules - fun performOperations() { - val inner = Inner() - inner.display() - - val sum = x + y // Space around operators - println("Sum: $sum") - - // Kotlin uses 'if' as its ternary operator - val message = if (sum > 10) "Greater than 10" else "Not greater than 10" - println(message) - - // If-else with spacing and brace style - if (sum % 2 == 0) { - println("Sum is even") - } else { - println("Sum is odd") - } - - // For loop demonstrating continuation indent - for (i in 0..4) { - print("$i ") - } +/** + * This class demonstrates proper code formatting following the specified style guide. + * + * **Formatting Rules:** + * - 2 spaces for indentation. + * - 4 spaces for continuation lines. + * - Max line length of 100 characters. + * - Spaces around operators, control structures, and keywords. + * - K&R brace style. + * - Consistent spacing for parameter lists and constructor arguments. + * - Doc comments with aligned descriptions. + */ +class WellFormattedCode { // (1)! - try { - throw Exception("Demo exception") - } catch (e: Exception) { - println("Caught exception: ${e.message}") - } finally { - println("Finally block executed") + /** + * This method calculates the factorial of a given positive integer. // Doc comment for method + * + * @param n The non-negative integer for which to calculate the factorial. + * @return The factorial of n, or throws an IllegalArgumentException if n is negative. + * @throws IllegalArgumentException If the provided number (n) is negative. + */ + fun calculateFactorial(n: Int): Long { // (2)! + if (n < 0) { // (3)! + throw IllegalArgumentException("Factorial is not defined for negative numbers.") } - } - // Inner class - inner class Inner { - fun display() { - println("Inside Inner class") + var result = 1L + for (i in 2..n) { // (4)! + result *= i } + return result } } - -fun main() { - val example = Example(3, 7) - example.performOperations() -} ``` + +1. Class name in PascalCase with a doc comment. +2. Method name in camelCase with a doc comment. +3. K&R brace style for blocks. +4. Proper spacing around operators and control structures. + /// [//]: # (@formatter:on) ## Naming Conventions -The naming conventions for Kotlin adhere to our [Foundational Code Standards][fnd-naming] +The naming conventions for Kotlin adhere to our foundational [naming conventions][NAMING] with no exceptions. - **PascalCase** for classes, interfaces, enums (definitions). - **camelCase** for functions, variables, properties. - - Prefix booleans with "is" or "has" for clarity. + - Prefix booleans with `is` or `has` for clarity. - **UPPER_SNAKE_CASE** for constants. - **lowercase** package names, concatenated words (avoid underscores). @@ -164,7 +149,7 @@ fun PrintGoatInfo(goat: goat) { ## Documentation and Comments -Refer to the [Foundational Code Standards][fnd-docs] for general commenting and documentation +Refer to the [Foundational Code Standards][DOCS] for general commenting and documentation guidelines. #### Documentation Example @@ -413,10 +398,10 @@ remains clean and consistent with Kotlin best practices. [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [KDoc]: https://kotlinlang.org/docs/kotlin-doc.html [Dokka]: https://kotlinlang.org/docs/dokka-introduction.html [Detekt]: https://deteky.dev diff --git a/docs/styles/objc.md b/docs/lang/objective-c.md similarity index 96% rename from docs/styles/objc.md rename to docs/lang/objective-c.md index e133fb5..6c7460e 100644 --- a/docs/styles/objc.md +++ b/docs/lang/objective-c.md @@ -6,14 +6,13 @@ the community standards and best practices for Objective-C development. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Objective-C. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Objective-C. /// [//]: # (@formatter:on) ## Formatting -The formatting guidelines for C++ adhere to our [Foundational Code Standards][fnd-formatting]. -Here is a brief overview: +The formatting rules for Objective-C adhere to our foundational [formatting standards][FORMATTING]: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. @@ -32,12 +31,11 @@ focus. ## Naming Conventions -The naming conventions for Objective-C adhere to our [Foundational Code Standards][fnd-naming] -_with no exceptions._ +The naming conventions for Objective-C adhere to our foundational [naming conventions][NAMING]: - **PascalCase** for classes, protocols, and enumeration types - **camelCase** for methods, variables, and properties. - - Prefix booleans with "is" or "has" for clarity. + - Prefix booleans with `is` or `has` for clarity. - **UPPER_SNAKE_CASE** for constants. - **lowercase** package names, concatenated words (avoid underscores). @@ -415,9 +413,9 @@ documentation. [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions [ObjC Guide]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html [Apple Coding Guidelines]: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html diff --git a/docs/styles/python.md b/docs/lang/python.md similarity index 92% rename from docs/styles/python.md rename to docs/lang/python.md index e218d0f..b9c8415 100644 --- a/docs/styles/python.md +++ b/docs/lang/python.md @@ -6,14 +6,14 @@ the nuances of Python development. It underscores idiomatic usage, performance, [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Python. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Python. /// [//]: # (@formatter:on) ## Formatting -While Python's PEP 8 provides comprehensive formatting guidelines, -our [Foundational Code Standards][fnd-formatting] also apply. Key Python-specific considerations +While Python's PEP 8 provides comprehensive formatting guidelines, our foundational +[formatting standards][FORMATTING] also apply. Key Python-specific considerations include: - **Indentation:** Use 4 spaces per indentation level. @@ -124,3 +124,8 @@ def goat_names(): - [Pylint](https://github.com/pylint-dev/pylint): A source code analyzer that checks for errors in Python code. [//]: # (@formatter:off) + +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments diff --git a/docs/styles/rust.md b/docs/lang/rust.md similarity index 97% rename from docs/styles/rust.md rename to docs/lang/rust.md index 81faade..29849ac 100644 --- a/docs/styles/rust.md +++ b/docs/lang/rust.md @@ -6,13 +6,13 @@ code that is not only efficient and safe but also clean, readable, and consisten [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Rust. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Rust. /// [//]: # (@formatter:on) ## Formatting -The formatting rules for Rust adhere to our [Foundational Code Standards][fnd-formatting] with the +The formatting rules for Rust adhere to our [Foundational Formatting Standards][FORMATTING] with the following exceptions: - **Indentation:** Use 4 spaces per indentation level. @@ -351,10 +351,10 @@ focus. [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Rust Book]: https://doc.rust-lang.org/book/ [Rust API Guidelines]: https://rust-lang.github.io/api-guidelines/ [Rust by Example]: https://doc.rust-lang.org/rust-by-example/ diff --git a/docs/styles/shell.md b/docs/lang/shell.md similarity index 95% rename from docs/styles/shell.md rename to docs/lang/shell.md index daf3ad5..5bd2412 100644 --- a/docs/styles/shell.md +++ b/docs/lang/shell.md @@ -7,13 +7,13 @@ scripts written in Bash or other shell languages. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Shell. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Shell. /// [//]: # (@formatter:on) ## Formatting -Follow the [Foundational Code Standards][fnd-formatting] with these shell-specific guidelines: +Follow the [Foundational Formatting Standards][FORMATTING] with these shell-specific guidelines: - **Indentation:** Use 2 spaces for indentation. - **Line Length:** Aim for 80 characters, with a hard limit of 100 characters per line. @@ -284,3 +284,8 @@ productivity. * [The Linux Documentation Project: Advanced Bash Scripting Guide](https://tldp.org/LDP/abs/html/) * [The Art of Command Line](https://github.com/jlevy/the-art-of-command-line) * [A guide to learn bash](https://github.com/Idnan/bash-guide) + +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments \ No newline at end of file diff --git a/docs/styles/swift.md b/docs/lang/swift.md similarity index 95% rename from docs/styles/swift.md rename to docs/lang/swift.md index 1208e8f..2c61c38 100644 --- a/docs/styles/swift.md +++ b/docs/lang/swift.md @@ -6,12 +6,11 @@ maintainability, and adherence to modern Swift idioms. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for Swift. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for Swift. /// [//]: # (@formatter:on) -The formatting guidelines for Swift adhere to our [Foundational Code Standards][fnd-formatting]. -Here is a brief overview: +The formatting rules for Swift adhere to our foundational [formatting standards][FORMATTING]: - **Consistent Indentation:** Use 2 spaces for indentation, 4 spaces for continuation lines. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. @@ -30,12 +29,12 @@ focus. ## Naming Conventions -The naming conventions for Swift adhere to our [Foundational Code Standards][fnd-naming] -with the following exceptions: +The naming conventions for Swift adhere to our foundational [naming conventions][NAMING] with the +following exception: - **camelCase** for constants to follow Swift's convention. -Otherwise, follow the conventions outlined in the foundational standards, briefly summarized below: +Otherwise, follow the conventions outlined in the foundational standards. - **PascalCase** for classes, structs, enums, and protocols. - **camelCase** for functions, variables, constants, and enum cases. @@ -293,10 +292,10 @@ variables have valid values before proceeding. [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [Swift Programming Guide]: https://docs.swift.org/swift-book/ [Swift API Design Guidelines]: https://swift.org/documentation/api-design-guidelines/ [Ray Wenderlich Guide]: https://www.raywenderlich.com/1997706-swift-style-guide-for-raywenderlich-com diff --git a/docs/styles/typescript.md b/docs/lang/typescript.md similarity index 86% rename from docs/styles/typescript.md rename to docs/lang/typescript.md index 7b86de1..7d0f564 100644 --- a/docs/styles/typescript.md +++ b/docs/lang/typescript.md @@ -6,14 +6,13 @@ and TypeScript-specific considerations. [//]: # (@formatter:off) /// admonition | type: abstract -[Foundational Code Standards][fnd]{:target="_blank"} provide the foundation, this guide extends them for TypeScript. +[Foundational Code Standards][FOUNDATION]{:target="_blank"} provide the foundation, this guide extends them for TypeScript. /// [//]: # (@formatter:on) ## Formatting -The formatting guidelines for TypeScript closely adhere to -our [Foundational Code Standards][fnd-formatting]. Here is a brief overview: +The formatting rules for TypeScript adhere to our foundational [formatting standards][FORMATTING]: - **Consistent Indentation:** Use 2 spaces for indentation. - **Line Length:** Aim for 100 characters, but allow flexibility for readability. @@ -30,7 +29,16 @@ Remember, these are guidelines; adapt them for your project's needs while keepin ## Naming Conventions -Adhere to our [Foundational Code Standards][fnd-naming] with the following TypeScript-specific clarifications: +The naming conventions for TypeScript adhere to our foundational [naming conventions][NAMING] +with no exceptions. + +- **PascalCase** for classes, interfaces, enums (definitions). +- **camelCase** for functions, variables, properties. + - Prefix booleans with `is` or `has` for clarity. +- **UPPER_SNAKE_CASE** for constants. +- **lowercase** package names, concatenated words (avoid underscores). + +**Additional Tips:** - **Interfaces:** Use PascalCase without an `I` prefix. - **Types:** Use PascalCase for type aliases and enum types. @@ -38,7 +46,7 @@ Adhere to our [Foundational Code Standards][fnd-naming] with the following TypeS ## Documentation and Comments -Refer to the [Foundational Code Standards][fnd-docs] for general commenting and documentation +Refer to the [Foundational Code Standards][DOCS] for general commenting and documentation guidelines. In TypeScript, use [TSDoc][TSDoc] for documenting code. Document all public APIs clearly with examples where applicable. @@ -179,9 +187,9 @@ To further enhance your TypeScript development skills and knowledge, consider ex [//]: # (links @formatter:off) -[fnd]: foundation.md -[fnd-formatting]: foundation.md#formatting -[fnd-naming]: foundation.md#naming-conventions -[fnd-docs]: foundation.md#documentation-and-comments +[FOUNDATION]: ../foundation.md +[FORMATTING]: ../foundation.md#formatting +[NAMING]: ../foundation.md#naming-conventions +[DOCS]: ../foundation.md#documentation-and-comments [TSDoc]: https://tsdoc.org/ [//]: # (links @formatter:on) From 6710bac1f41296c4c9c8a0a49c9adcb016607931 Mon Sep 17 00:00:00 2001 From: Jared Rummler Date: Thu, 28 Mar 2024 09:24:39 -0700 Subject: [PATCH 3/4] docs: Update YML and JSON for new paths --- docs/assets/cards/languages.json | 24 +++++++++++----------- mkdocs.yml | 35 ++++++++++++++++---------------- 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/docs/assets/cards/languages.json b/docs/assets/cards/languages.json index bf948d5..c2b1b96 100644 --- a/docs/assets/cards/languages.json +++ b/docs/assets/cards/languages.json @@ -1,62 +1,62 @@ [ { "title": "C++", - "url": "styles/cpp.md", + "url": "lang/cpp.md", "image": "assets/img/cplusplus.svg" }, { "title": "C#", - "url": "styles/csharp.md", + "url": "lang/csharp.md", "image": "assets/img/csharp.svg" }, { "title": "Dart", - "url": "styles/dart.md", + "url": "lang/dart.md", "image": "assets/img/dart.svg" }, { "title": "Go", - "url": "styles/go.md", + "url": "lang/go.md", "image": "assets/img/go.svg" }, { "title": "Java", - "url": "styles/java.md", + "url": "lang/java.md", "image": "assets/img/java.svg" }, { "title": "JavaScript", - "url": "styles/javascript.md", + "url": "lang/javascript.md", "image": "assets/img/javascript.svg" }, { "title": "Kotlin", - "url": "styles/kotlin.md", + "url": "lang/kotlin.md", "image": "assets/img/kotlin.svg" }, { "title": "Objective-C", - "url": "styles/objc.md", + "url": "lang/objective-c.md", "image": "assets/img/objective-c.svg" }, { "title": "Python", - "url": "styles/python.md", + "url": "lang/python.md", "image": "assets/img/python.svg" }, { "title": "Rust", - "url": "styles/rust.md", + "url": "lang/rust.md", "image": "assets/img/rust.svg" }, { "title": "Swift", - "url": "styles/swift.md", + "url": "lang/swift.md", "image": "assets/img/swift.svg" }, { "title": "TypeScript", - "url": "styles/typescript.md", + "url": "lang/typescript.md", "image": "assets/img/typescript.svg" } ] \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 16a5c51..e160c3f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: "Code Style Guides" +site_name: "GoatStyles" site_description: "The official code style guides used by GoatBytes.IO." site_url: https://styles.goatbytes.io repo_url: https://github.com/goatbytes/GoatStyles @@ -9,21 +9,21 @@ edit_uri: "blob/develop/docs/" nav: - Home: index.md - - Foundational Code Standards: styles/foundation.md - - Style Guides: - - C++: styles/cpp.md - - C#: styles/csharp.md - - Dart: styles/dart.md - - Go: styles/go.md - - Objective-C: styles/objc.md - - Java: styles/java.md - - JavaScript: styles/javascript.md - - Kotlin: styles/kotlin.md - - Python: styles/python.md - - Rust: styles/rust.md - - Shell: styles/shell.md - - Swift: styles/swift.md - - TypeScript: styles/typescript.md + - Foundational Code Standards: foundation.md + - Languages: + - C++: lang/cpp.md + - C#: lang/csharp.md + - Dart: lang/dart.md + - Go: lang/go.md + - Objective-C: lang/objective-c.md + - Java: lang/java.md + - JavaScript: lang/javascript.md + - Kotlin: lang/kotlin.md + - Python: lang/python.md + - Rust: lang/rust.md + - Shell: lang/shell.md + - Swift: lang/swift.md + - TypeScript: lang/typescript.md - Contribute: contributing.md - About: - GoatBytes.IO: about.md @@ -40,7 +40,7 @@ theme: - navigation.top - search.suggest - search.highlight - - toc.integrate +# - toc.integrate - content.code.annotate palette: - scheme: default # Palette toggle for light mode @@ -104,6 +104,7 @@ extra_javascript: - 'assets/js/app.js' extra: + homepage: https://goatbytes.io social: - icon: fontawesome/brands/x-twitter link: https://x.com/goatbytes From de1b69a6fbc6a5567ad548289ec8f9011a6ce3be Mon Sep 17 00:00:00 2001 From: Jared Rummler Date: Thu, 28 Mar 2024 09:25:11 -0700 Subject: [PATCH 4/4] site: Update copyright in footer --- docs/assets/js/app.js | 8 +------- docs/overrides/partials/copyright.html | 12 ++++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/docs/assets/js/app.js b/docs/assets/js/app.js index ee73038..34aae58 100644 --- a/docs/assets/js/app.js +++ b/docs/assets/js/app.js @@ -5,10 +5,4 @@ console.log(` | ) _ \\ \\ / / \`\` w w w w -`); - -document.addEventListener("DOMContentLoaded", function() { - document.querySelectorAll('.good-code').forEach(e => { - console.log(e); - }); -}); \ No newline at end of file +`); \ No newline at end of file diff --git a/docs/overrides/partials/copyright.html b/docs/overrides/partials/copyright.html index 770d6e5..36be024 100644 --- a/docs/overrides/partials/copyright.html +++ b/docs/overrides/partials/copyright.html @@ -1,8 +1,8 @@ \ No newline at end of file