Skip to content

Commit 0e456ee

Browse files
Merge pull request #6 from jeremy-farrance/AccuTheme-AccuKit11
Ignore the Branch name; worked on DocFX
2 parents 57f3d26 + f9641ba commit 0e456ee

File tree

177 files changed

+10044
-45
lines changed

Some content is hidden

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

177 files changed

+10044
-45
lines changed

Libraries/AccuLadder/Accu/DevHelper.cs

+6-25
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace Accuraty.Libraries.AccuLadder
1515
public partial class Accu
1616
{
1717
/// <summary>
18-
/// Accu.Dev Helper - Tools, utilities, and shortcuts for DNN and 2SC projects
18+
/// Accu.Dev Helper - Tools, utilities, and shortcuts to assist with developing stuff inside DNN and 2SC projects
1919
/// </summary>
2020
public class Dev
2121
{
@@ -139,29 +139,6 @@ public static string CombinePathSegments(string pathSeparator = "/", params stri
139139
return combinedPath;
140140
}
141141

142-
/// <summary>
143-
/// Turn any text or title in to a URL Slug
144-
/// </summary>
145-
/// <param name="phrase">Any string to be converted to a Slug</param>
146-
/// <remarks>Source: https://stackoverflow.com/questions/2920744/url-slugify-algorithm-in-c</remarks>
147-
/// <remarks>TODO find better version that does more (with hyphens; multiples and trailing)</remarks>
148-
public static string ToSlug(string phrase)
149-
{
150-
byte[] bytes = Encoding.GetEncoding("Cyrillic").GetBytes(phrase);
151-
string str = Encoding.ASCII.GetString(bytes);
152-
str = str.ToLower();
153-
// invalid chars
154-
str = Regex.Replace(str, @"[^a-z0-9\s-]", "");
155-
// convert multiple spaces into one space
156-
str = Regex.Replace(str, @"\s+", " ").Trim();
157-
// cut and trim
158-
str = str.Substring(0, str.Length <= 45 ? str.Length : 45).Trim();
159-
str = Regex.Replace(str, @"\s", "-"); // space to hyphen
160-
str = Regex.Replace(str, @"-{2,}", "-"); // multiple hyphens to one hyphen
161-
str = str.Trim('-'); // trim hyphens from ends
162-
return str;
163-
}
164-
165142
/// <summary>
166143
/// Get the version of an installed DLL in /bin
167144
/// </summary>
@@ -241,8 +218,12 @@ public static string GetIpAddressFromHost(string host)
241218
}
242219
return ip;
243220
}
244-
}
245221

222+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
223+
[Obsolete("Deprecated, instead use: Accu.Web.ToSlug(phrase)")]
224+
public static string ToSlug(string phrase) { return Accu.Web.ToSlug(phrase); }
225+
226+
}
246227

247228
} // class Accu
248229
} // end of namespace Accuraty.Libraries.AccuLadder

Libraries/AccuLadder/Accu/DnnHelpers.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ namespace Accuraty.Libraries.AccuLadder
1414
/// </summary>
1515
public partial class Accu
1616
{
17-
/// <summary>
18-
/// Accu.Dnn Helper - Tools, utilities, and shortcuts for DNN-specific things
19-
/// </summary>
17+
18+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2019
public partial class Dnn
2120
{
2221
/// <summary>

Libraries/AccuLadder/Accu/IconHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Accuraty.Libraries.AccuLadder
1313
public partial class Accu
1414
{
1515
/// <summary>
16-
/// Accu.Dnn Helper - Tools, utilities, and shortcuts for DNN-specific things
16+
/// Accu.Icon Helper - Simple syntax to an Icon on the page
1717
/// </summary>
1818
public partial class Icon
1919
{

Libraries/AccuLadder/Accu/NxHelper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public partial class Accu
99
{
1010

1111
/// <summary>
12-
/// Accu.Nx Helper - Experimental Tools, utilities, and shortcuts for 2sxc-specific things
12+
/// Accu.Nx Helper - Experimental Tools, utilities, and shortcuts for DNN or 2sxc things
1313
/// </summary>
1414
public class Nx
1515
{

Libraries/AccuLadder/Accu/WebHelper.cs

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System.Web;
22
using System.Drawing; // TODO Remove this dependency? But what to replace it with? Microsoft's System.Drawing.Common? Open Source ImageSharp?
3+
using System.Text.RegularExpressions;
4+
using System.Text;
35

46
namespace Accuraty.Libraries.AccuLadder
57
{
@@ -10,10 +12,33 @@ public partial class Accu
1012
{
1113

1214
/// <summary>
13-
/// Accu.Sxc Helper - Tools, utilities, and shortcuts for 2sxc-specific things
15+
/// Accu.Web Helper - Tools, utilities, and shortcuts for web-specific things
1416
/// </summary>
1517
public class Web
1618
{
19+
/// <summary>
20+
/// Turn any text or title in to a URL Slug
21+
/// </summary>
22+
/// <param name="phrase">Any string to be converted to a Slug</param>
23+
/// <remarks>Source: https://stackoverflow.com/questions/2920744/url-slugify-algorithm-in-c</remarks>
24+
/// <remarks>TODO find better version that does more (with hyphens; multiples and trailing)</remarks>
25+
public static string ToSlug(string phrase)
26+
{
27+
byte[] bytes = Encoding.GetEncoding("Cyrillic").GetBytes(phrase);
28+
string str = Encoding.ASCII.GetString(bytes);
29+
str = str.ToLower();
30+
// invalid chars
31+
str = Regex.Replace(str, @"[^a-z0-9\s-]", "");
32+
// convert multiple spaces into one space
33+
str = Regex.Replace(str, @"\s+", " ").Trim();
34+
// cut and trim
35+
str = str.Substring(0, str.Length <= 45 ? str.Length : 45).Trim();
36+
str = Regex.Replace(str, @"\s", "-"); // space to hyphen
37+
str = Regex.Replace(str, @"-{2,}", "-"); // multiple hyphens to one hyphen
38+
str = str.Trim('-'); // trim hyphens from ends
39+
return str;
40+
}
41+
1742
/// <summary>
1843
/// Get the width from an image file
1944
/// </summary>

Libraries/AccuLadder/Accu/_CompatibilityHelper.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public class AccuKit
2727
public static HtmlString BootstrapIcon(string iconName) { return Accu.Theme.BootstrapIcon(iconName); }
2828
[Obsolete("Deprecated, instead use: Accu.Dnn.IsSuper()")]
2929
public static bool isSuperUser() { return Accu.Dnn.IsSuper(); }
30-
[Obsolete("Deprecated, instead use: Accu.Dev.ToSlug(phrase)")]
31-
public static string ToSlug(string phrase) { return Accu.Dev.ToSlug(phrase); }
30+
[Obsolete("Deprecated, instead use: Accu.Web.ToSlug(phrase)")]
31+
public static string ToSlug(string phrase) { return Accu.Web.ToSlug(phrase); }
3232
/// <summary>Obsolete: Deprecated, use: Accu.Dev.GetIpAddress() instead</summary>
3333
[Obsolete("Deprecated, instead use: Accu.Dev.IsAccuratyIp()")]
3434
public static bool isAccuratyIP() { return Accu.Dev.IsAccuratyIp(); }

Libraries/AccuLadder/README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
# AccuLadder
22

3-
## How to Generate the Docs
3+
## How to Generate the Docs (DocFX)
44

5-
On REMOTE101, PowerShell or command line to C:\dev\gen\
6-
Then, run the following command: `docfx .\docfx\docfx.json --serve`
5+
PowerShell or command line to C:\dev\gen\docfx
6+
Then, run the following command: `docfx build docfx.json [--serve]`
77
Then, browse to http://localhost:8080/
88

9-
TODO: Add a script to do this automatically and public to GitHub Pages
9+
It builds into `C:\dev\gh.io\jeremy-farrance\AccuLadder` which is git remote for
10+
https://github.com/jeremy-farrance/jeremy-farrance.github.io
11+
12+
To publish, open the VS Code project and publish main directly to the remote repo.
13+
14+
Key files:
15+
- docfx.json
16+
- templates/modern/
17+
- layout/_master.tmpl
18+
- public/main.css
19+
- others?
20+
21+
TODO: Automate all the above on Release builds
1022

1123
[Current Documentation (WIP v1.0.8)](https://jeremy-farrance.github.io/AccuLadder/api/Accuraty.Libraries.AccuLadder.html)
1224

Libraries/AccuLadder/releasenotes.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11

22
<h2>AccuLadder Libraries Extension for DNN</h2>
33

4+
<p>Version 01.00.09</p>
5+
<ul>
6+
<li>Add IconHelper; works, but needs think, renaming, refactoring</li>
7+
<li>Fixed .ToSlug; moved from Accu.Dev to Accu.Web</li>
8+
<li>Got DocFX working well, slightly customized the theme</li>
9+
<li>Added How To Generate Docs details in README.md</li>
10+
<li>Minor clean ups, other trivial fixes like capitalization</li>
11+
</ul>
412
<p>Version 01.00.08</p>
513
<ul>
614
<li>including 01.00.07.00 (.06 thru .07.02)</li>

docfx/articles/intro.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# Add your introductions here!
1+
# AccuLadder Examples
2+
3+
- ACCU4: More / [AccuLadder](https://www.accu4.com/AccuThings/AccuLadder)
4+
- ACCU4: More / [AccuLadder Experiments](https://www.accu4.com/More-/AccuLadder-Experiments)
5+
6+
# Initial Projects using AccuLadder v1.x Alpha and Beta
7+
8+
- [ACCU4.COM](https://accu4.com)
9+
- BEACN2023 (VPN/WEBSVR4)
10+
- FASS/AETA2023
11+
- FASS/ARPAS2023
12+
- CCFP2023

docfx/docfx.json

+10-4
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,21 @@
4646
]
4747
}
4848
],
49-
"output": "_site",
49+
"output": "../../gh.io/jeremy-farrance/AccuLadder",
5050
"globalMetadataFiles": [],
5151
"fileMetadataFiles": [],
5252
"template": [
53-
"default",
54-
"modern"
53+
"templates/default",
54+
"templates/modern"
5555
],
56+
"globalMetadata": {
57+
// Other metadata...
58+
"_appTitle": " Open Source by Accuraty Solutions",
59+
"_appFooter": "Note: a clear blue sky is just the surface of the ocean of the universe.",
60+
"_appLogoPath": "images/accu-logo.svg"
61+
},
5662
"postProcessors": [],
5763
"keepFileLink": false,
5864
"disableGitFeatures": false
5965
}
60-
}
66+
}

docfx/images/accu-logo.svg

+1
Loading

docfx/index.md

+91-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,92 @@
1-
# This is the **HOMEPAGE**.
2-
Refer to [Markdown](http://daringfireball.net/projects/markdown/) for how to write markdown files.
1+
# AccuLadder v1.0.9+
2+
This is the basic reference for Accuraty's common library of tools, utilities, and doohickies for DNN+2sxc projects.
3+
This replaces AccuKit so far and will also replace RazorKit, AccuKit11, and other libraries that are used in
4+
Accuraty's DNN+2sxc projects (usually in the /App_Code folder).
5+
36
## Quick Start Notes:
4-
1. Add images to the *images* folder if the file is referencing an image.
7+
8+
### Installation
9+
Install the latest release from the project's [GitHub Release](https://github.com/jeremy-farrance/AccuratySolutions-2023/releases) page in the usual DNN way.
10+
> [!CAUTION]
11+
> This applies to Accuraty projects only. Intallation on projects with old libraries in the /App_Code folder require some additional steps;
12+
this was expected, see JRF. More on this <mark>below</mark>.
13+
14+
### Upgrade
15+
Install a newer version, its a normal DNN extension install, it will just upgrade the existing version.
16+
17+
## Alpha and Experimental
18+
This project is in alpha and experimental. Any release marked `Latest` is good for production use. It is not recommended for use in any project that is not under active development by a developer who is familiar with the code and is able to fix any issues that may arise.
19+
20+
## How to Use
21+
Once AccuLadder is installed, you can use it in your C# code like this
22+
23+
### .cs files
24+
```csharp
25+
using Accuraty.Libraries.AccuLadder;
26+
27+
string phoneNumber = Accu.Text.FormatPhone("914.555.1212");
28+
// result: (914) 555-1212
29+
```
30+
31+
### .cshtml files (2sxc Views or RazorHost)
32+
```csharp
33+
@using Accuraty.Libraries.AccuLadder
34+
35+
@{
36+
string urlSlug = Accu.Web.ToSlug("** Special ** Board Meeting -- Nov 2022);
37+
// result: special-board-meeting-nov-2022
38+
}
39+
```
40+
41+
### .ascx files (Theme files and user controls)
42+
```csharp
43+
<%@ Import Namespace="Accuraty.Libraries.AccuLadder" %>
44+
45+
<p class="small mt-2 mb-0"
46+
title="Current User is Super: <%=Accu.Dnn.IsSuper() %>"
47+
>
48+
```
49+
50+
<hr>
51+
52+
## AccuKit Notes
53+
<mark>AccuKit (in the /App_Code folder) is no longer needed.</mark>
54+
AccuLadder replaces it. To make the transition easy, compatability was added to AccuLadder to support
55+
the old namespace (AccuKit.) and classes. This means that you can and should install AccuLadder, but
56+
you need to:
57+
1. Delete `/App_Code/AccuKit.cshtml`
58+
2. Search through the project and find all occurrence of `AccuKit.`
59+
3. At the top each page where it was used, add a `using` statement for `Accuraty.Libraries.AccuLadder` (see examples above)
60+
4. No other changes should be necessary, see JRF is issues arise
61+
62+
### What about RazorKit, AccuKit11, and others?
63+
No conflict so far, but in the future, when "replacement compatibility" is added to AccuLadder, the same process
64+
(as AccuKit above) will apply.
65+
66+
## Roadmap Possibilites and Ideas
67+
- [ ] How did we lose .IsUrlSpecial() and what is the new method name?
68+
- [ ] Add more documentation
69+
- [ ] Add replacement compatibility for RazorKit, AccuKit11, and others
70+
- [ ] How do we handle /App_Code/AccuTheme.cshtml in the AccuTheme* projects?
71+
- [ ] Add AccuComponents.Buttons (or move forward on Stencil web components version of AccuComponents)?
72+
- [ ] .Dev.Log(); add non-ephemeral logging to [files, database, other]? (or use 2sxc logging? or something else (Serilog?))?
73+
- [ ] .Dnn.[roles]; helpers that work the way Accuraty does
74+
- [ ] see IsSM() in BEACN2023; one-offs that define a permission grouping
75+
- [ ] new .IsInRoles() that work for lists of RoleId or RoleNames
76+
- [ ] above need to support both && and || logic (all or any)
77+
- [ ] .GetRoleNameById() and .GetRoleIdByName()
78+
- [ ] modernize the project as compositional interfaces, IAccuWeb, IAccuText, etc.?
79+
- [ ] setup so using AccuLadder can be done via Dependency Injection
80+
- [ ] setup so using AccuLadder can be done using NuGet
81+
- [ ] Can we implement a terser syntax w/o adding (maintenance) complexity?
82+
- [ ] Are we really a billion years away from plant/animal semiosis?
83+
84+
## Links to self-docs in the project
85+
- [README.md](https://github.com/jeremy-farrance/AccuratySolutions-2023/blob/main/Libraries/AccuLadder/README.md)
86+
- [Release Notes](https://github.com/jeremy-farrance/AccuratySolutions-2023/blob/main/Libraries/AccuLadder/releasenotes.txt)
87+
- more?
88+
89+
## Accuraty Solutions
90+
- [Accuraty](https://accuraty.com)
91+
- [ACCU4](https://accu4.com) - Accuraty's DNN+2sxc reminders, learnings, and related stuff
92+
- [GitHub/Accuraty](https://github.com/Accuraty)

docfx/templates/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
These started life as exports 20231107 JRF
2+
https://github.com/mapbox/mapbox-unity-sdk/issues/14#issuecomment-295596387

0 commit comments

Comments
 (0)