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,39 @@
|
||||
private async IAsyncEnumerable<DocumentKey> SearchDocumentsAsync(
|
||||
OrgSlug org,
|
||||
string? searchTerm,
|
||||
DocumentTypeSet documentTypes,
|
||||
bool includeUntypedDocuments,
|
||||
DocumentRelativePath? startAfter,
|
||||
[EnumeratorCancellation] CancellationToken cancellationToken)
|
||||
{
|
||||
var query = searchTerm?.Trim();
|
||||
|
||||
await foreach (var doc in ListDocumentsAsync(org, startAfter, cancellationToken))
|
||||
{
|
||||
if (!doc.Type.MatchesFilter(documentTypes, includeUntypedDocuments))
|
||||
continue;
|
||||
|
||||
if (!String.IsNullOrEmpty(query) && !doc.Name.Matches(query))
|
||||
continue;
|
||||
|
||||
yield return doc;
|
||||
}
|
||||
}
|
||||
|
||||
// Houston/Model/Documents/DocumentName.cs
|
||||
public bool Matches(string pattern)
|
||||
{
|
||||
return Value.Contains(pattern, StringComparison.CurrentCultureIgnoreCase);
|
||||
}
|
||||
|
||||
// Houston/Model/Documents/DocumentType.cs
|
||||
public bool MatchesFilter(DocumentTypeSet documentTypes, bool includeUntypedDocuments)
|
||||
{
|
||||
if (documentTypes.IsEmpty && !includeUntypedDocuments)
|
||||
return true;
|
||||
|
||||
if (documentType is null)
|
||||
return includeUntypedDocuments;
|
||||
|
||||
return documentTypes.Types.Contains(documentType.Value);
|
||||
}
|
||||
Reference in New Issue
Block a user