Edit:
citeproc-lua now contains it's own LaTeX package, it added support for BibTeX files and it uses the normal LaTeX citation commands. It is available on CTAN, so you can install it using tlmgr.
See also the instructions on how to run the example:
\documentclass{article}
\usepackage{citation-style-language}
\cslsetup{style = apa}
\addbibresource{example.bib}
\begin{document}
Foo \cite{ITEM-1} bar \cite{ITEM-1, ITEM-2} baz.
\printbibliography
\end{document}
Result:

Original answer:
There is now a full Lua version of Citeproc. It doesn't contain TeX interface yet, but simple package for LuaLaTeX that uses it can look like this citeproc.sty:
\ProvidesPackage{citeproc}
\RequirePackage{luacode}
% Basic initialization of Citeproc.lua
\begin{luacode*}
require("lualibs")
-- global object for functions defined in this
CSL = {}
local dom = require("luaxml-domobject")
local formats = require("citeproc.citeproc-formats")
local CiteProc = require("citeproc")
local function read_file(path)
local file = io.open(path, "r")
if not file then return nil end
local content = file:read("*a")
file:close()
return content
end
function CSL.load_style(filename)
CSL.style = read_file(filename)
end
function CSL.load_json(filename)
CSL.bib = CSL.bib or {}
local items = utilities.json.tolua(read_file(filename))
if not items then
return nil, "JSON file cannot be loaded: " .. filename
end
for _, item in ipairs(items) do
CSL.bib[item["id"]] = item
end
end
function CSL.load_lang(lang)
CSL.lang= lang
end
function CSL.load_style(style)
CSL.style = read_file(style)
end
function make_citeproc_sys(bib)
local bib = bib
local citeproc_sys = {
retrieveLocale = function (self, lang)
local locale_name_format = CSL.locale_name_format or "locales-%s.xml"
local filename = string.format(locale_name_format, lang)
local content = read_file(filename)
if content then
return dom.parse(content)
else
return nil
end
end,
retrieveItem = function (self, id)
return bib[id]
end
}
return citeproc_sys
end
function CSL.init()
CSL.bib = CSL.bib or {}
local citeproc_sys = make_citeproc_sys(CSL.bib)
CSL.citeproc = CiteProc:new(citeproc_sys, CSL.style)
CSL.citeproc.formatter = formats.latex
end
function CSL.cite(citation)
local cite_items = {}
for item in string.gmatch(citation, "([^,]+)") do
cite_items[#cite_items+1] = {id = item}
end
local result = CSL.citeproc:makeCitationCluster(cite_items)
tex.print(result)
end
function CSL.bibliography()
local params, result = CSL.citeproc:makeBibliography()
tex.print("\begin{thebibliography}{}")
for _,bibitem in pairs(result) do
bibitem = bibitem:gsub("bibitem%[.-%]","bibitem")
tex.print(bibitem)
end
tex.print("\end{thebibliography}")
end
\end{luacode*}
\newcommand\cslstyle[1]{%
\luaexec{CSL.load_style("#1")}
}
\newcommand\csljson[1]{%
\luaexec{CSL.load_json("#1")}
}
\newcommand\cslinit{%
\luaexec{CSL.init()}
}
\newcommand\cslcite[1]{%
\luaexec{CSL.cite("\luaescapestring{#1}")}
}
\newcommand\cslbibliography{\luaexec{CSL.bibliography()}}
% initialize citeproc
\AtBeginDocument{%
\cslinit%
}
\endinput
It doesn't support BibTeX files, it needs JSON at the moment. To run the following example, download bib.json, simple.csl, and locales-en-US.xml from the Citeproc-lua example directory.
The sample.tex file:
\documentclass{article}
\usepackage{citeproc}
\cslstyle{simple.csl}
\csljson{bib.json}
\begin{document}
hello world \cslcite{ITEM-1,ITEM-2}
\cslbibliography
\end{document}
You can compile it using LuaLaTeX. This is the result:
