@@ -85,7 +85,7 @@ import { quartoConfig } from "../../core/quarto.ts";
8585import { metadataNormalizationFilterActive } from "./normalize.ts" ;
8686import { kCodeAnnotations } from "../../format/html/format-html-shared.ts" ;
8787import { projectOutputDir } from "../../project/project-shared.ts" ;
88- import { relative } from "../../deno_ral/path.ts" ;
88+ import { basename , relative } from "../../deno_ral/path.ts" ;
8989import { citeIndexFilterParams } from "../../project/project-cites.ts" ;
9090import { debug } from "../../deno_ral/log.ts" ;
9191import { kJatsSubarticle } from "../../format/jats/format-jats-types.ts" ;
@@ -660,7 +660,11 @@ async function quartoFilterParams(
660660 params [ kHasResourcePath ] = hasResourcePath ;
661661
662662 // The source document
663- params [ kQuartoSource ] = options . source ;
663+ if ( options . project . isSingleFile ) {
664+ params [ kQuartoSource ] = basename ( options . source ) ;
665+ } else {
666+ params [ kQuartoSource ] = options . source ;
667+ }
664668
665669 // profile as an array
666670 params [ kQuartoProfile . toLowerCase ( ) ] = activeProfiles ( ) ;
@@ -860,7 +864,7 @@ async function resolveFilterExtension(
860864 }
861865
862866 let pathToResolve : string | null = null ;
863-
867+
864868 if ( typeof filter === "string" ) {
865869 pathToResolve = filter ;
866870 } else if ( typeof filter === "object" && filter . path ) {
@@ -869,7 +873,9 @@ async function resolveFilterExtension(
869873
870874 if ( pathToResolve ) {
871875 // The filter string points to an executable file which exists
872- if ( existsSync ( pathToResolve ) && ! Deno . statSync ( pathToResolve ) . isDirectory ) {
876+ if (
877+ existsSync ( pathToResolve ) && ! Deno . statSync ( pathToResolve ) . isDirectory
878+ ) {
873879 return filter ;
874880 }
875881
@@ -896,17 +902,19 @@ async function resolveFilterExtension(
896902 if ( typeof filter === "string" ) {
897903 return extensionFilters ;
898904 } else if ( isFilterEntryPoint ( filter ) ) {
899- return extensionFilters . map ( extFilter => {
905+ return extensionFilters . map ( ( extFilter ) => {
900906 if ( typeof extFilter === "string" ) {
901907 return {
902- type : extFilter . endsWith ( ".lua" ) ? "lua" : "json" as "lua" | "json" ,
908+ type : extFilter . endsWith ( ".lua" )
909+ ? "lua"
910+ : "json" as "lua" | "json" ,
903911 path : extFilter ,
904- at : filter . at
912+ at : filter . at ,
905913 } ;
906914 } else {
907915 return {
908916 ...extFilter ,
909- at : filter . at
917+ at : filter . at ,
910918 } ;
911919 }
912920 } ) ;
0 commit comments