appendix: 23 Code-Ausschnitte aus dem Houston-Repository
Pin nixpkgs to the revision used by itc.componentware: the channel version ships a latexminted that crashes on Python 3.14, which made every listing fail and sent latexmk into an endless error prompt. Also force nonstopmode/halt-on-error so a broken listing can never loop again.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace Houston.Model.Documents;
|
||||
|
||||
public readonly record struct DocumentName(string Value)
|
||||
{
|
||||
public bool Matches(string pattern)
|
||||
{
|
||||
return Value.Contains(pattern, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether this document is a PDF and therefore eligible for the inline modal preview.
|
||||
/// </summary>
|
||||
public bool IsPdf => Value.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// Whether this is an external document link (a .URL file).
|
||||
/// </summary>
|
||||
public bool IsLink => Value.EndsWith(".url", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
/// <summary>
|
||||
/// File display name.
|
||||
/// </summary>
|
||||
public string DisplayName => IsLink ? Value[..^".url".Length] : Value;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override string ToString() => Value;
|
||||
}
|
||||
Reference in New Issue
Block a user